Image copyright AFP Image caption Ties between Japan and China have been repeatedly strained by a territorial row over rocky islands

Japan has confirmed that it intends to purchase disputed islands also claimed by China from private owners, amid tension between the two countries.

The government had formally agreed to ''obtain ownership'' of islands called Senkaku in Japan and Diaoyu in China, the top government spokesman said.

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

China has denounced the plan as illegal and warned it will affect ties.

Chief Cabinet Secretary Osamu Fujimura said the Japanese government was buying the islands to promote their stable and peaceful management.

It was not immediately clear how much the purchase would cost. But previous Japanese media reports, citing government sources, said that the government was paying 2.05bn yen ($26m, £16.4m) for three islands.

"This is just the ownership of land, which is part of Japan's territory, moving from one [private] owner to the state, and should not cause any problem with other countries," said Mr Fujimura.

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

Japanese businessman Kunioki Kurihara owns three of the islands, which he rents 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

"We do not want the Senkaku issue to interfere with Sino-Japanese relations," he added.

"We believe it is important to avoid misunderstandings and unforeseen circumstances between us, and have been using diplomatic channels to keep in close contact with China since they made their position on this matter clear."

Outspoken Tokyo Governor Shintaro Ishihara had wanted the Tokyo Metropolitan Government to buy the islands and had been collecting donations from the public. He had talked of developing the islands - a plan that could have further strained ties with China.

At the Apec summit in Russia on Sunday, Chinese President Hu Jintao was quoted by state-run media as telling Japanese Prime Minister Yoshihiko Noda that buying the islands was "illegal and invalid".

His point was reiterated by a foreign ministry spokesman, Hong Lei, on Monday.

"The unilateral measures that Japan has taken on the Diaoyu islands are illegal and ineffective. China is firmly opposed to it," he said.

The islands, which lie south of Okinawa and north of Taiwan, sit in key shipping lanes and are thought to lie close to gas deposits.