Thousands of protesters besieged the Japanese embassy in Beijing on Saturday, hurling rocks and bottles at the building as police struggled to keep control, amid growing tensions between Asia's two biggest economies over a group of disputed islands.
Paramilitary police with shields and batons barricaded the embassy, holding back slogan-chanting, flag-waving protesters who at times appeared to be trying to storm the building.
"Return our islands! Japanese devils get out!" some of the protesters shouted. One of them held up a sign reading: "For the respect of the motherland, we must go to war with Japan."
As tensions escalated, and reports emerged of other protests around China, Japan said its foreign minister had cut short a visit to Australia, arriving back in Tokyo on Saturday morning to deal with the situation.
The long-standing territorial dispute escalated dramatically on Friday when China sent six surveillance ships to a group of uninhabited islets in the East China Sea, raising tensions between the two countries to their highest level since 2010.
China had sent the ships in response to the Japanese government's decision on Tuesday to buy the islands, which Tokyo calls the Senkaku and Beijing calls the Diaoyu, from a private Japanese owner despite Chinese warnings against doing so.
In Shanghai, streets around the Japanese consulate, in the western part of town, were cordoned off on Saturday. Hundreds of police let small groups of people in at a time to protest.
Japanese media said big anti-Japan protests were also being held in the Chinese cities of Xian, Suzhou, Changsha and Nanjing.
Pictures on China's popular Twitter-like site, Sina Weibo, showed hundreds of protesters marching down a street in the southwestern city of Kunming with banners and Chinese flags.
There have been sporadic protests around China throughout the week, though those in Beijing had been small and peaceful.
The dispute flared up last month after Japan detained a group of Chinese activists who had landed on the islands.
Diplomats say Tokyo and Beijing want to keep the row from spiralling out of control, but managing the situation can be difficult given that China is undergoing a leadership change, an election is looming in Japan and mutual mistrust runs deep.
Relations between Beijing and Tokyo chilled in 2010, after Japan arrested a Chinese trawler captain whose boat collided with Japanese Coast Guard vessels near the islands.
Sino-Japanese relations have long been plagued by China's bitter memories of Japan's military aggression in the 1930s and 1940s and present rivalry over resources and regional clout.