SHANGHAI/BEIJING - Shouting "Japanese invaders must die", thousands protested against Japan's wartime past in eastern China on Saturday, hurling rocks and bottles and burning Japanese flags at Tokyo's consulate in Shanghai.

However, with thousands of paramilitary police on the streets of Beijing and students warned against protesting, authorities appeared to have headed off a repeat of last weekend's demonstrations in the capital, which will host Japan's foreign minister on Sunday.

Police also barred demonstrations in southern Guangzhou and southwestern Chongqing, where thousands took to the streets last weekend.

Chinese have been protesting against textbooks they see as whitewashing Japan's wartime past, and against Tokyo's bid for a permanent seat on the UN Security Council.

In the third weekend of violent protests against Japan across China, thousands marched on the Japanese consulate in Shanghai, smashing windows with rocks, pelting it with paint bombs and attacking Japanese restaurants along the way.

Marchers set fire to the red-and-white Japanese flag. Some held posters carrying messages such as "Face Up to History", while another warned: "The anti-Japan war is not over yet".

A Japanese car was overturned by protesters, left covered with scratches and "Boycott Japan" scrawled on its side.

Hundreds of paramilitary police in full riot gear stood ready as police appealed for order on loud hailers. Isolated scuffles broke out and about a dozen protesters were dragged away.

During moments of relative calm, protesters and police alike were spotted buying lattes at a nearby coffee shop.

In the scenic eastern city of Hangzhou, about 10,000 protesters chanted anti-Japanese slogans, carried banners and handed out fliers calling for a boycott of Japanese goods, witnesses said. Journalists were told not to report on it and warned they would be sacked if they took part.

Billboards featuring Japanese electronics goods were covered up in Hangzhou as were restaurant signs in Beijing. Another 2,000 people marched in Tianjin city, near the capital.

In Beijing, hundreds of police in riot gear secured the ambassador's home in the northeast diplomatic district and the embassy in the southeast. Both were hit by rocks and bottles by thousands of protesters last weekend but spared this time around.

China appears keen to keep the capital quiet.

Japanese Foreign Minister Nobutaka Machimura is due to meet his counterpart Li Zhaoxing on Sunday, and aims to ensure disputes on everything from gas exploration in disputed waters to Japan's history do not hurt $US178 billion ($NZ249.75 billion) in annual trade between the economic powers.

Japan has pledged not to let the series of disputes hinder their broader relationship.

Many Chinese fume at what they see as Japan's failure to own up to atrocities committed during its occupation of China from 1931 to 1945. Beijing estimated that up to 35 million Chinese were killed or wounded by invading Japanese troops.

Anger flared after Tokyo's approval this month of a history textbook written by Japanese nationalist scholars that many in Asia say glosses over Japan's wartime past.

After last weekend's protests, the situation worsened on Wednesday after Japan announced it had started procedures to allocate rights for test-drilling in a disputed area of the East China Sea.

China has come under fire for tacitly encouraging the unrest, which started in Guangdong and Sichuan provinces early this month, spread to Beijing last week and, now, to nearby Tianjin and Shanghai and Hangzhou on the east coast.

Beijing denies it deliberately allowed things to spiral and pledged to protect Japanese businesses and nationals in China.

"I have to point out here that such allegations are totally groundless and a serious distortion of truth," State Councillor Tang Jiaxuan, a former foreign minister, said.

Tang blamed the tensions on repeated visits by Japanese leaders, including Prime Minister Junichiro Koizumi, to the Yasukuni shrine -- where convicted war criminals are honoured along with Japan's war dead.

Authorities appeared to be clamping down harder in Beijing to keep the capital peaceful during Machimura's visit. University students were warned by email not to protest.

The South China Morning Post in Hong Kong quoted unidentified sources as saying top anti-Japanese activists in Beijing were rounded up to prevent protests. One activist, Hu Jian, was put under house arrest on Friday, it said.

In Japan, Kyodo news agency said an envelope containing harmless starch-like white powder was sent to the Chinese Embassy in Tokyo on Friday. Private broadcaster TV Tokyo said on Saturday a caller had rung the embassy, threatening to blow it up. Police would not confirm either incident.