BEIJING — They accuse each other of inciting violence. They denounce one another as corrupt. They call each other terrorists.
As tensions between the United States and Iran persist after the American killing of a top Iranian general this month, the two countries are waging a heated battle in an unlikely forum: the Chinese internet.
The embassies of the United States and Iran in Beijing have published a series of barbed posts in recent days on Weibo, a popular Chinese social media site, attacking each other in Chinese and in plain view of the country’s hundreds of millions of internet users.
The United States Embassy has accused Iran of “leaving bloodstains everywhere.” The Iranian Embassy has denounced the Jan. 3 killing of the general, Qassim Suleimani, and vowed to seek the end of “America’s evil forces in western Asia.”
The battle has captivated people in China, where diplomatic rows rarely break into public view and the government often censors posts about politics.
The trolling comes at a time when the United States is pressuring American technology companies to censor content by groups the government has identified as terrorist organizations. Reports have emerged that Facebook, for example, is censoring some pro-Iran posts, including on Instagram. The company said in a statement that it was obliged to review some posts in order to comply with American sanctions.
Iran, for its part, has for years sought to hinder the flow of information from the West more broadly, blocking Facebook, Twitter and other social networks.
Chinese news outlets have covered the skirmish breathlessly, describing Weibo as the “new battlefield” between the two countries. A hashtag referring to the “Weibo fight” had been viewed more than 1.5 million times as of Thursday.
The Chinese authorities operate one of the world’s most aggressive censorship systems, routinely scrubbing reports, comments and posts on the internet that are deemed politically sensitive or subversive. Posts by foreign diplomats are known to have been censored, especially on topics such as North Korea or human rights.
But the government has so far allowed the war of words between the United States and Iran to continue, perhaps because it deflects attention away from issues in China, analysts said.
“Any topic that provides a distraction from internal problems in China is beneficial to Beijing,” said Fergus Ryan, an analyst with the Australian Strategic Policy Institute who has studied China’s censorship of posts by foreign embassies. “This just happens to be a case where Beijing sees little downside for itself as Iran and the U.S. squabble.”
Many Chinese internet users have used the occasion to criticize the United States as an “imperialist” power, echoing a favorite propaganda theme of Beijing. Others have praised Weibo for allowing the discussion to be published, reacting to the news that Facebook had been censoring some posts.
The American Embassy, which has more than 2.6 million followers on Weibo, said it welcomed the debate.
“We expect critical discussion and debate, which might include both support and criticism of U.S. policy,” the embassy said in a statement, describing its approach to social media in China.
The Iranian Embassy, with more than 300,000 followers, did not respond to a request for comment.
China and Iran have sought closer relations in recent years, especially as American sanctions have increased economic pressure on Tehran.
Iran’s foreign minister, Mohammad Javad Zarif, visited Beijing in late December, just days before the killing of the general, to meet with his Chinese counterpart, Wang Yi. At the meeting, Mr. Wang criticized overseas “bullying practices,” a remark that was seen as aimed at the United States.
In its Weibo posts, the Iranian Embassy made a point of appealing to Chinese internet users, thanking them for their support and even suggesting that they visit Iran for the upcoming Lunar New Year holiday (“safety is not an issue,” the embassy wrote).
Iran might be particularly eager to gain attention and validation from the Chinese public, experts said.
“China has provided Iran with very important economic and political lifelines in recent years when U.S. sanctions have choked that country,” said Hongying Wang, an associate professor of political science at the University of Waterloo in Canada.
Positive responses from Chinese commenters could help “boost the legitimacy of the Iranian government in the eyes of its own people,” she added.
Albee Zhang contributed research.