BEIJING—Protests are erupting in major cities in China over President Xi Jinping ‘s zero-tolerance approach to Covid-19, an unusual show of defiance in the country as the economic and social costs from snap lockdowns and other strict restrictions escalate.

Demonstrations occurred throughout the weekend in both Beijing and Shanghai. According to eyewitness accounts, there were also protests in the eastern city of Nanjing and in Wuhan, the original epicenter of the pandemic. Video footage and photos circulating on social media, which The Wall Street Journal wasn’t able to independently verify, suggest protests broke out in several other cities, including Chengdu, capital of Sichuan province.

The protests followed demonstrations on Friday in Urumqi, capital of the remote region of Xinjiang, where a deadly fire enraged residents who had struggled with lockdowns of more than 100 days. Residents flooded social media with comments suggesting that Covid restrictions contributed to a delay in putting out the fire, in which officials said 10 people died.

In Beijing, hundreds of protesters marched on Sunday night. A large police presence pinned protesters near the Liangmahe river, a popular spot for family picnics by day that is close to many foreign embassies. “Freedom,” the protesters shouted in unison. 

Open displays of anger are rare in China, where crackdowns on dissent have intensified over the past decade. Having protests over the same issue break out in multiple Chinese cities is almost unheard of, outside of nationalist outpourings, such as anti-Japanese protests. Since the Tiananmen Square protests in 1989, the ruling Communist Party has allowed some local demonstrations but made it a priority to prevent nationwide protests.

Demonstrators marched through Beijing on Sunday night holding up blank sheets of paper, an allusion to censorship, as they protested the Chinese government’s strict anti-Covid policies.

Photo: mark r cristino/Shutterstock

The weekend protests were remarkable considering the sheer size of China’s surveillance state and the consequences that dissidents can face in China, including lengthy prison terms. Just last month when a banner opposing Mr. Xi was unfurled on a highway overpass in Beijing, it was viewed as an exceptionally rare act of public defiance. On Sunday, many protesters were willing to express their discontent in full view of the police. 

Many Beijing residents who participated said they were undeterred by the risks and determined to force change to the tight grip over society and daily life that China’s government has wrought since Mr. Xi took power. One 27-year-old protester who carried a bouquet of flowers in honor of those who died in the Urumqi fire said he was scared but hoped to bring about changes in China, “even just a little bit.”

While some scuffling ensued, Beijing’s police forces appeared to seek to avoid provoking the protests further. By early Monday morning, as police were in the process of dispersing remaining crowds, cars jamming Beijing’s Third Ring Road nearby began to honk in a deafening show of support for the protesters, with many drivers hanging a thumbs-up out of their windows. 

Signs that unrest after the deadly fire in Urumqi was spreading beyond Xinjiang became apparent on Saturday, when videos circulating on social media showed crowds gathering on a street in central Shanghai calling for a lifting of lockdowns. The videos were verified by Storyful, a social-media research company owned by News Corp, parent company of The Wall Street Journal.

One clip showed protesters standing around a sign that says Wulumuqi Middle Road, named after Urumqi. The protest started as a spontaneous and quiet memorial service for the dead in Urumqi, with people carrying flowers and lighted candles, according to witnesses. 

One middle-aged Shanghai resident said he stopped by on his way home and joined the crowd in singing “Do You Hear the People Sing?” from the musical “Les Misérables” and the Chinese national anthem. A friend who grew up in Xinjiang began to cry, he said. 

The protests began in Urumqi, capital of remote Xinjiang region and site of this image from a video, after the deadly fire there.

Photo: Video Obtained by Reuters

“[We in] Shanghai can relate to that, because we had gone through such a long lockdown,” he said, referring to more than two months of iron-fisted Covid controls imposed on the city earlier this year.

The mood intensified. Using expletives and call-and-response chanting, some protesters began to denounce both Mr. Xi and his Covid-control strategy. Another clip from the scene showed demonstrators standing across from lines of police. 

The clip showed one man chanting, “The Communist Party.” Others responded, “Step down.”

“ Xi Jinping, ” the man shouted. “Step down,” others responded.

Other videos and photographs circulating online showed students demonstrating at the Communication University of China in Nanjing, with one clip showing some chanting, “Long live the people.”

The Journal spoke with people in both Shanghai and Nanjing who confirmed that the clips showed events taking place in those cities on Saturday.

On the campus of Peking University, one of the country’s most prestigious schools, students wrote anti-Covid protest slogans in red paint and roughly 200 later gathered to sing “The Internationale,” according to an undergraduate student who participated. School authorities tried to get the crowd to disperse, but the students mocked them, saying that the only thing they were good at was censoring speech, the student said. 

“It was exciting to see the students were so emboldened,” he said.

On Chinese social-media, users raced against censors to spread images and news of the protests, along with expressions of solidarity. “Long live the people, may the dead rest in peace,” said a message that spread widely. Others posted an image of a blank white sheet of paper—a nod to censorship—with the words “I love you, China. I love you, young people.” 

President Xi Jinping’s zero-tolerance approach to Covid-19 has been the target of the unusual protests.

Photo: Jack Taylor/Associated Press

The protests continued Sunday, with students gathering around noon on the campus of Tsinghua University, another elite school in Beijing. Some in the crowd carried sheets of paper that were either blank or had an exclamation mark inside a red circle—the symbol that indicates an online post has been deleted—according to witness video footage shared with the Journal. The students sang songs and chanted “Democracy and rule of law!” 

A school official spoke to the crowd with a megaphone and asked if they would agree that things were getting better since the government unveiled measures to reduce restrictions earlier this month, the footage showed. Several in the crowd responded “No!”

Peking University and Tsinghua didn’t respond to requests for comment. A person answering the phone at the Shanghai municipal government said no one was available to answer questions on the weekend. Subsequent calls rang unanswered. Calls to the Beijing municipal government and Communication University in Nanjing rang unanswered.

Urumqi officials said after the fire last week that rescuers had to remove some barriers but attributed a delay in putting out the fire to too many cars parked in the compound. On Saturday, Urumqi officials said normal activities would gradually resume in areas of the city considered at low risk for Covid.

The protests highlight the rising toll on Chinese society from a Covid strategy built around mass testing and confinement to quash even minor outbreaks—an approach that has become increasingly unsustainable.

The strategy saved lives and proved effective earlier in the pandemic, which started in Wuhan in early 2020. It has come to underpin Mr. Xi’s view that China has managed the virus better than the West.

However, more contagious strains of Covid-19 have since made it all but impossible to completely clear out the virus. Beijing has been relying largely on domestically developed vaccines with a lower efficacy than mRNA shots. Meanwhile, frequent lockdowns have kept businesses closed and pushed up youth unemployment, with China now facing its worst slowdown in decades.

Wary of the high stakes, China’s top leadership earlier this month unveiled plans to “optimize and adjust” the policy to rescue the economy. However, local officials across the country doubled down on restrictions when cases started to rise recently.

People in Shanghai on Saturday mourned victims of the deadly fire in a residential building in Urumqi, Xinjiang.

Photo: /Associated Press

“A lot of people are reaching the breaking point,” said Yanzhong Huang, a public-health expert at the Council on Foreign Relations, who has been closely monitoring the Covid situation in China.

China saw nearly 40,000 new Covid-19 cases Saturday, including 4,307 in Beijing, according to the latest official tally.

Mr. Huang and several other analysts compared the waves of Covid-related protests with the public sentiment around the 1989 Tiananmen protests.

“If mishandled by the government, the highly volatile situation could quickly evolve into the most severe political crisis since Tiananmen,” said Mr. Huang.

Following the Urumqi fire, users of social-media platform Weibo left fresh comments under the last post by Li Wenliang, a Wuhan doctor whose death from Covid-19 in 2020 sparked an outpouring of anger at authorities who had tried to prevent him from publicizing the outbreak.

“Dr. Li, you were the whistleblower when the virus came. With the fog so thick, who will light the way for us now?” said one of the comments. 

Videos uploaded Sunday on Chinese social media, with geolocation tags showing they were shot in Wuhan, show residents smashing road barriers set up during the pandemic, while others shout “lift the restrictions!”

A college student in Wuhan said he defied his compound’s Covid restrictions Sunday night, joining hundreds of his neighbors to protest. Some were chanting “no more Covid tests”; others were merely walking in silence, the student said. A few were still in their pajamas. 

“I was really tearing up,” the student said. He said he has spent most of his time at college in campus lockdown and has tolerated that for the most part. But when a resident in a nearby neighborhood was forcefully dragged to a quarantine center after isolating at his apartment for more than a week, he started to question the local Covid-control measures. 

“My university campus has been basically a large prison,” he said. 

Footage he posted on Weibo of protesters singing the national anthem near a Wuhan shopping area was later removed. The student said he didn’t delete the video. Weibo didn’t immediately reply to an email request for comment. 

The Wuhan government didn’t immediately respond to an emailed request for comment. Calls to the government offices rang unanswered Sunday evening.

Police detained several protesters in Urumqi and Shanghai, but authorities appear to have largely refrained from large-scale violent confrontation with demonstrators. 

A Shanghai resident who attended Saturday’s protest said he was bewildered that authorities didn’t act more aggressively after people began calling for the downfall of the Communist Party. 

“Perhaps the police were waiting for instructions from above,” said the resident.

—Stella Yifan Xie, Cao Li and Liyan Qi contributed to this article

Write to Lingling Wei at Lingling.Wei@wsj.com, Brian Spegele at brian.spegele@wsj.com and Wenxin Fan at wenxin.fan@wsj.com