NEW DELHI - Indian Prime Minister Narendra Modi pledged on Tuesday to strengthen Vietnam’s military following talks between leaders of the two allies, in a move likely to rankle neighouring nuclear-armed giant China.

Modi said India would sell naval patrol boats to Vietnam under a $100 million line of credit to the Southeast Asian nation, which is seeking to improve its defences in the disputed South China Sea.

Modi held talks in New Delhi with Prime Minister Nguyen Tan Dung, who is on a two-day visit to India, as Hanoi courts powerful allies following soured relations with China over the disputed territory.

Modi, who swept to power in May, said the two leaders had agreed to strengthen bilateral ties, adding “our defence co-operation with Vietnam is among our most important ones”.

“India remains committed to the modernisation of Vietnam’s defence and security forces.”

The leaders also called for “restraint” and “freedom of navigation” in the South China Sea, where China is embroiled in a bitter dispute with Vietnam and other nations.

“They agreed that freedom of navigation and overflight in the East Sea/South China Sea should not be impeded,” a joint statement released after the talks said.

“The (leaders called on the) parties concerned to exercise restraint, avoid threat or use of force and resolve disputes through peaceful means in accordance with universally recognised principles of international law.”

In May, Beijing moved a deep-water oil rig into waters claimed by Hanoi, prompting a months-long high-seas standoff and triggering deadly anti-China riots in Vietnam.

The rig was removed in July.

Modi’s comments came after China’s top foreign policy official made his second visit Monday to Vietnam in four months in a bid to repair ties strained to breaking point.

India has long had its own tense ties with China following a brief but bloody war in 1962 with its powerful neighbour over their remote land border.

Modi’s first meeting with Dung since his election comes after the defence line of credit was announced last month during a visit by India’s president to Vietnam.

Dung said late Monday that he hoped India would “actively support” a peaceful resolution to the South China Sea dispute.

“Vietnam hopes that India, as a major power in the region and the world, will actively support the parties concerned to peacefully resolve all disputes,” he told the Press Trust of India news agency.

Vietnam staunchly opposes China’s ongoing efforts to develop airstrips and military bases on the island chains it controls in the South China Sea.

China says it has sovereignty over essentially all of the South China Sea, which is a crucial maritime route and is also believed to hold huge oil and gas deposits.