Media playback is unsupported on your device Media caption The BBC's Rupert Wingfield-Hayes explains the background to the tension

Six Chinese surveillance ships briefly entered waters around islands claimed by both Japan and China, amid a bitter territorial dispute.

China said the ships were carrying out "law enforcement" to show jurisdiction over the islands, called Diaoyu in China and Senkaku in Japan.

Three vessels left after a short time and the other three have now also left, the Japanese coast guard said.

The move came after Japan sealed a deal to buy three of the islands.

Japan controls the uninhabited but resource-rich East China Sea islands, which are also claimed by Taiwan.

Three were in the hands of a private Japanese owner but the Japanese government bought them earlier this week.

'No force'

The Japanese Coast Guard said the first two Chinese boats entered Japan's territorial waters at 06:18 local time (21:18 GMT Thursday), followed by another fleet of four other ships just after 07:00.

Japan-China disputed islands The archipelago consists of five islands and three reefs

Japan, China and Taiwan claim them; they are controlled by Japan and form part of Okinawa prefecture

The Japanese government signed a deal in September 2012 to purchase three islands from Japanese businessman Kunioki Kurihara, who used to rent them out to the Japanese state

The islands were the focus of a major diplomatic row between Japan and China in 2010 Q&A: China-Japan islands row

Three ships moved away from the islands about 90 minutes later, amid warnings from the Japanese coast guard, followed hours later by the other three, NHK reported.

Japanese Prime Minister Yoshihiko Noda established a task force to address the issue, local reports said, and the government also summoned the Chinese ambassador to lodge a protest.

"We understand that the dispatch of six ships is surely an unprecedented case, considering past incidents," Chief Cabinet Secretary Osamu Fujimura said.

He added that Japan asked China to "secure the safety" of its nationals after a report from its Shanghai consulate that a Japanese group was "assaulted by Chinese" at a restaurant.

The Chinese Foreign Ministry confirmed early on Friday that its ships were there.

"These law enforcement and patrol activities are aimed to demonstrate China's jurisdiction over the Diaoyu Islands and its affiliated islets and ensure the country's maritime interests," a statement said.

Trade fears

The US has called for ''cooler heads to prevail'' as tension intensifies between China and Japan over the islands, which lie south of Okinawa and north of Taiwan.

US Defense Secretary Leon Panetta is due to visit both Japan and China from this weekend as part of a tour of the region.

The dispute has seriously marred diplomatic relations between China and Japan and threatens to damage the strong trading relationship, says the BBC's John Sudworth in Beijing.

The row has also generated strong nationalist sentiment on both sides that observers say now makes it very difficult to be seen to be backing down, says our correspondent.

The Japanese government says it is buying the islands to promote their stable and peaceful management.

Its move followed a bid by right-wing Tokyo Governor Shintaro Ishihara to buy the islands using public donations - an action that would likely have provoked China even more.

China, on the other hand, says the islands have historically been its territory and fishing grounds.

Meanwhile Japan's newly-appointed ambassador to China, Shinichi Nishimiya, remains in hospital in Tokyo after he was found unconscious near his home in Tokyo on Thursday.

No details have been given on his condition. He was appointed on Tuesday to replace Uichiro Niwa, who has been criticised for his handling of one of the worse diplomatic rows between Japan and China in recent years.