In Shanghai, restaurants and bars in many neighborhoods are teeming with crowds. In Beijing, thousands of students are heading back to campus for the fall semester. In Wuhan, where the coronavirus emerged eight months ago, water parks and night markets are packed elbow to elbow, buzzing like before.

While the United States and much of the world are still struggling to contain the coronavirus pandemic, life in many parts of China has in recent weeks become strikingly normal. Cities have relaxed social distancing rules and mask mandates, and crowds are again filling tourist sites, movie theaters and gyms.

“It no longer feels like there is something too frightful or too life-threatening out there,” said Xiong Xiaoyan, who works at a paint manufacturer in the southern province of Guangdong.

Xiong, who described the restrictions put in place to combat the virus as “suffocating,” recently visited a movie theater for the first time since the outbreak

“When the lights turned dark, I felt I had returned to my normal life,” she said. “I could forget about everything outside and have my own spiritual world.”

The return to normalcy has made China an outlier in the global economy.

The United States is facing a potentially long and painful recession, as some places have reimposed restrictions to contend with a surge in cases this summer. Several countries in Europe have been experiencing fresh outbreaks, putting additional pressure on an already weak economy. By contrast, China has been slowly recovering in recent months, and its factories are humming again, although its growth is still weaker than before the pandemic, and job losses are significant.

It is a stark turnabout from the early days of the pandemic, when China was the epicenter of the outbreak and the authoritarian government imposed sweeping lockdowns. Across the country, life came to a halt and the economy cratered as people were forced to stay at home and shops largely shut down, except those selling essential goods.

In Wuhan, the streets were all but deserted, except for government vehicles and delivery drivers ferrying food and supplies. Hospitals were overrun with patients as nervous residents with coughs and fevers sought treatment. A sense of anger and anxiety permeated the city while residents grappled with a rapidly mounting death toll and uncertainty about when the lockdown would end.

Despite a delayed response and early missteps by the government, the recovery in China points to the success of the extreme tactics. After months of travel restrictions and citywide testing drives, locally transmitted cases of the virus in China are near zero, according to official data.

Now many Chinese cities are once again hosting large events, though with some limits on crowd sizes, after months when such gatherings were banned entirely.

Qingdao, a seaside city in eastern China, held its popular beer festival in August largely as planned (face masks were optional). Shanghai recently held a gaming convention that attracted thousands of enthusiasts.

Many people are resuming old routines, with some modifications, hopeful that the worst has passed.

China’s leaders, hoping to bolster the economy, are eager for people to get back to work and start shopping and traveling again.

But they are also taking a cautious approach, requiring movie theaters and tourist sites, for example, to operate at half-capacity. To get into banks, restaurants and other public venues, residents must submit to temperature checks and show digital codes verifying that they are healthy and have not traveled recently to areas where there have been clusters of new cases.

Authorities continue to restrict travel in the Xinjiang region in western China, where an outbreak last month prompted a lockdown. China still prohibits most foreigners from entering the country, for fear they could bring the virus.

There have been outbreaks in recent months, but in each case the response was swift. When Wuhan reported six coronavirus cases in May, breaking a streak of more than a month without any confirmed infections, the city launched a plan to test all 11 million of its people. And when a new cluster emerged in Beijing in June, authorities quickly reimposed some lockdown measures to contain it.

While China is not the only place where restrictions have eased — Taiwan, for example, has kept the virus under control for months — the semblance of normalcy has become a point of national pride and fodder for the country’s vast propaganda apparatus.

The state news media is pointing to the return of large gatherings and classes as evidence of China’s superior response to the virus, especially compared with the United States and other Western countries whose officials are still dealing with large outbreaks.

When photos circulated worldwide in recent days showing thousands of people swimming shoulder to shoulder at a pool rave in Wuhan, prompting some criticism overseas, Chinese commentators were quick to defend the party. Global Times, a state-run newspaper, called the reaction to the photos “foreign sour grapes.”