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.