Japan's Foreign Ministry denounced the ''destructive and violent actions" of the protesters and said it had ''strongly protested" to the Chinese government.
''Even though information was available beforehand to infer that there would be a demonstration, nothing was done to prevent it," the ministry said in a statement.
But the Shanghai government faulted Japan, saying the protest was sparked by ''Japan's wrong attitudes and actions on a series of issues such as its history of aggression," China's official Xinhua news agency quoted government spokeswoman Jiao Yang as saying.
Jiao called for calm and asked residents not to participate in unauthorized demonstrations.
Thousands of people also participated in peaceful protest marches in Hangzhou and Tianjin, defying government demands for restraint.
In Beijing, hundreds of police blanketed Tiananmen Square in the center of China's capital to block a planned protest.
State television did not mention the protests in its main evening news report, apparently reflecting fears by communist leaders that they could further damage the sour relations with Tokyo or encourage others to take to the streets against corruption or demand political reforms.
Earlier this month, protesters smashed windows at the Japanese Embassy in Beijing and marched in other Chinese cities.
The violence prompted several Japanese companies -- including Mazda Motor Corp., Suzuki Motor Corp., and Toshiba Corp. -- to cancel business trips to China, while others told employees in China to take safety precautions.
Some have suggested that Beijing has permitted recent protests to support a campaign against Tokyo's bid for a permanent Security Council seat.
The five current permanent members -- Britain, China, France, Russia, and the United States -- have veto power over UN actions.