HANOI (Reuters) - Japan will give six navy boats to Vietnam to boost its patrols and surveillance in the South China Sea, Japan's foreign minister said on Friday, in the latest sign of a strengthening of alliances between states locked in maritime rows with China.

The used vessels, worth 500 million yen ($4.86 million), would be accompanied by training and equipment to help the coastguard and fisheries surveillance effort, Japanese Foreign Minister Fumio Kishida said after talks with Vietnamese counterpart Pham Binh Minh.

The deal represents a notable shift in the two countries' close diplomatic and investment ties towards defense, a move likely to irk an increasingly assertive China that is pressing hard on claims to nine-tenths of the potentially energy-rich sea, and worrying much of the region.

"International security is getting more complicated... prosperity only comes with stability in the South China Sea and the East China Sea," Kishada told a news conference in Hanoi.

"I hope this equipment will strengthen the ability of Vietnam's coastal enforcement authorities."

Vietnam enjoys tight business ties with Japan, its biggest investor, but relations with Hanoi's largest trade partner, China, are at their worst in three decades and analysts believe that has sharpened the debate within Vietnam's secretive Communist Party over long-term foreign policy strategy.

Beijing's May 2 deployment of a drilling rig in waters Vietnam claims as its exclusive economic zone lit the fuse on simmering anti-China sentiment in Vietnam, worsened by accusations that the southeast Asian country's fishing boats were deliberately rammed by Chinese vessels.

LIVE-FIRE DRILLS

That led to rare protests, rioting and arson in Vietnam aimed at Chinese factories, although Taiwan facilities were worst hit.

The rig was moved out of contested waters on July 16, a month before schedule, but it remains unclear if the two countries struck a deal behind the scenes. China said the rig was shifted because its mission had been completed.

China is not showing any sign of easing off on its maritime push. It will hold live-fire drills for five days from Tuesday off its coast in the East China Sea opposite Japan and in the Gulf of Tonkin, which borders both China and Vietnam, according to the Ministry of National Defence.

The Japanese support for Vietnam will include radar equipment and the vessels are to be handed over by year end, according to a Japanese government source in Tokyo, who requested anonymity.

Japan's already fragile ties with China have soured over their competing claims to a string of uninhabited East China Sea islets that Beijing calls Diaoyu and Tokyo refers to as Senkaku.

China also has overlapping South China Sea claims with Taiwan, Malaysia, Brunei and the Philippines, to which Vietnam has recently cosied up, and says may follow in pursuing international legal action against China.

Soldiers from both countries drank beer and played soccer during a party on an island in the disputed Spratly archipelago in June, in what was widely seen as a provocative show of unity.($1=102.9100 yen)