China appears to be in a state of panic, while the country is overtaken by rare protests.

Chinese police assaulted and detained a BBC journalist covering a protest in Shanghai on Sunday, releasing him after several hours, the broadcaster has said.

“The BBC is extremely concerned about the treatment of our journalist Ed Lawrence, who was arrested and handcuffed while covering the protests in Shanghai,” a spokesperson for the British public service broadcaster said.

“He was held for several hours before being released. During his arrest, he was beaten and kicked by the police. This happened while he was working as an accredited journalist.”

Lawrence later shared the statement from the BBC on social media and said he understood at least one local national was arrested after trying to stop police from beating him.

Speaking in Beijing, the Chinese foreign ministry spokesman, Zhao Lijian, said the BBC’s statement did not reflect what had happened, and that he did not identify himself as a reporter or show his press credentials.

“According to our understanding, the BBC’s statement is not true. According to authorities in Shanghai the journalist in question did not reveal his journalist identity at the time, he did not openly show his foreign press card,” Zhao said.

“When the incident happened, law enforcement personnel asked people to leave, and when certain people did not cooperate they were taken away from the scene.”

Foreign reporters in China are required to carry a government-issued card identifying themselves as accredited journalists when covering news events.

Shanghai is one of a number of Chinese cities that have seen protests over stringent Covid restrictions. Protests flared in recent days after a deadly fire in China’s far west.

Footage on social media showed a man whom other journalists identified as Lawrence being arrested by men in police uniforms.

The BBC said it had not been given a credible explanation for Lawrence’s detention.

“We have had no official explanation or apology from the Chinese authorities, beyond a claim by the officials who later released him that they had arrested him for his own good in case he caught Covid from the crowd.”

After his release, Lawrence tweeted on Monday to thank his followers, adding he believed “at least one local national was arrested after trying to stop the police from beating me”.

The UK foreign secretary, James Cleverly, called the incident “deeply disturbing”.

“Media freedom and freedom to protest must be respected. No country is exempt,” he tweeted. “Journalists must be able to do their job without intimidation.”

A spokesperson for the British prime minister called Lawrence’s arrest “shocking and unacceptable”. But the spokesperson also said the government would not “conflate” its stance on human rights issues like this with its desire to have a constructive relationship with China on other issues.

China’s embassy in London has been approached for comment.