China's incoming leader re-emerged this weekend after an unexplained two-week absence, just in time to see the country he's about to inherit consumed with rabid anti-Japanese nationalism that his Communist Party unleashed, and which the United States warned on Sunday could lead to a regional war.

Beijing's rapidly deteriorating relationship with Tokyo will top the agenda as Xi Jinping takes over as general secretary of the Communist Party from President Hu Jintao, a promotion expected as early as next month. While Mr. Xi will continue to share power with Mr. Hu for months afterward, the stakes could scarcely be higher for his first test.

Six days of sanctioned anti-Japanese protests – which escalated Sunday into a nationwide day of rage that saw Japanese businesses and diplomatic missions attacked – have whipped up hatred and created a situation that leaves the Chinese leadership little room to compromise in a showdown over disputed islands in the East China Sea. Japanese Prime Minister Yoshihiko Noda, who is on the verge of calling an election that will see him challenged from the nationalist right, similarly has little room to negotiate.

Story continues below advertisement

U.S. Defense Secretary Leon Panetta said he was worried the growing tensions between China and Japan could result in a war that would "have the potential of expanding."

The U.S. is bound by treaty to defend Japan in the event it is attacked. China and Japan are the world's second and third-largest economies.

"A misjudgment on one side or the other could result in violence, and could result in conflict," Mr. Panetta said in Tokyo at the start of a tour that will take him to Beijing this week for talks with senior leaders.

The confrontation over the uninhabited islets, known as Senkaku in Japan and Diaoyu in China, escalated from obscure to alarming last week after Tokyo moved to purchase them from the Japanese family that privately owned them for the past four decades. Beijing responded by unilaterally declaring new sea borders around the islands and then dispatching patrol boats to the area on Friday. Japanese boats were also sent to the area, leading to a nine-hour pursuit before the Chinese ships finally left the disputed waters.

That showdown at sea was followed by a weekend of dangerous street theatre around China. Tens of thousands took part in marches in dozens of cities Saturday and Sunday that were officially condoned and disturbingly xenophobic. "Declare war on Japan!" thousands shouted as they marched past the Japanese Embassy in Beijing. Some waved portraits of Mao Zedong, and pelted the embassy gate with eggs and bottles as rows of military police looked on.

Japanese restaurants a few blocks away were forced to close, draping their exteriors in red Chinese flags so as to leave no question as to where their loyalties lay. An adjacent Chinese restaurant on the same street drew crowds by putting up signs declaring "pet dogs welcome, but not Japanese dogs."

"We insist that the government take some hard actions" to seize the disputed islands, said Lu Zhentao, the restaurant's manager. "The Japanese attitude is that they will not bow their heads to us."

Story continues below advertisement

In the southern city of Guangzhou, a crowd smashed the windows of a building housing the Japanese consulate. In the neighbouring city of Shenzhen, police used tear gas, water cannons and pepper spray to disperse an estimated crowd of 10,000 that attacked a Japanese department store. In all, demonstrations were reported in 85 Chinese cities.

Anger is expected to rise ahead of Tuesday's anniversary of the Mukden Incident of 1931, a staged attack on a Japanese railway line that was used as pretext for the Imperial Army's invasion of Manchuria, and later the rest of China, at the outset of the Second World War. Considered a day of national humiliation in China, the anniversary is marked by protests even when ties between Beijing and Tokyo are businesslike.

"Regrettably, [there] is a problem concerning the safety of Japanese nationals and Japan-affiliated companies," Mr. Noda said in televised remarks Sunday. "I would like to urge the Chinese government to protect their safety."

However, Mr. Noda gave no indication he was considering Chinese demands that Japan abandon its purchase of the disputed islands. Tokyo does not recognize any dispute over the ownership of the islands, which have been in Japanese hands since 1895, except for a 26-year American occupation following the Second World War.

China's own claim is based on the fact the islands appeared on Chinese maps for centuries before the Japanese annexed them.

Beijing is also unlikely to back down ahead of its own sensitive transition of power, which is expected to begin in late October and which requires the support of the hawkish leadership of the People's Liberation Army. Seven of the nine current members of the all-powerful Standing Committee of the Politburo are due to retire at an upcoming Communist Party meeting, making way for a new generation of leaders headed by Mr. Xi, the current vice-president.

Story continues below advertisement

Mr. Xi returned to the public eye on Saturday – the Xinhua news agency published five photographs of him touring the China Agricultural University on Saturday – after an unexplained 13-day absence, putting to rest rumours that he was deathly ill or had been targeted in an assassination attempt.

He looked hale during his visit to the university, but did not address the showdown with Japan in brief remarks reported by Xinhua.

Many protesters outside the Japanese Embassy in Beijing spoke of boycotting Japanese products until Tokyo withdrew its purchase of the disputed islets.

"If Chinese people boycott Japanese products, I don't believe the Japanese could be so aggressive," said 36-year-old Zhang Binglan, an insurance saleswoman who said Sunday's protest was the first time in her life she had ever joined a political demonstration.

The Communist Party initially encouraged the protests with inflammatory media coverage of the islands dispute and laissez-faire policing that cleared a route for the demonstrators and allowed them to bring in boxes of eggs and other projectiles. But, as passions rose, police began trying to calm the crowd, using loudspeakers to urge the demonstrators to respect the law.

"I agree with their patriotism, but I disagree with their way of expressing it," Zhang Liguo, a 17-year-old performing arts student, said of the attacks on Japanese interests. He wore a handmade sign reading: "Drive away the disrespectful Japanese!"

Story continues below advertisement

Some saw the protests as a convenient distraction for the Communist Party.

Even before Mr. Xi's disappearing act, the party was dealing with the fallout of the scandalous Bo Xilai affair, which saw the one-time rising political star purged amid allegations he had helped cover up the murder of a British businessman by his wife Gu Kailai.

The treason trial of Wang Lijun, Mr. Bo's former police chief in the southeastern city of Chongqing – who instigated his downfall by trying to seek refuge in a U.S. consulate – begins Tuesday, the same day the anti-Japanese demonstrations are expected to crest.

"It's all staged. Only the Japanese could help us to have such a demonstration," dissident artist Ai Weiwei told The Globe and Mail while wandering past Sunday's protest in Beijing. "We haven't had such street protests for decades. The Japanese are helping us get back our rights."