HANOI: India said Saturday it is giving Vietnam half a billion dollars in credit to boost defence ties, the latest security deal between the two nations seeking to counter Beijing's muscle-flexing in the South China Sea.

Indian Prime Minister Narendra Modi made the announcement during a visit to Hanoi, which has gone on a spending spree in recent years to expand and modernise its military arsenal amid territorial disputes with Beijing in the strategically vital waterway.

"I am also happy to announce a new defence credit for Vietnam of $500 million for facilitating deeper defence cooperation," Modi told reporters after signing the deal.

Prime Minister Narendra gestures next to Vietnamese Deputy Prime Minister Vu Duc Dam (R) as he is greeted during a visit to the Quan Su pagoda in Hanoi on Sep 3 ─ AFP

He did not specify details of the arrangement, but traditionally such lines of credit would oblige Vietnam to sign contracts with Indian companies.

About 50 per cent of India's trade passes through the South China Sea, where Beijing has built up islands and outcrops capable of supporting military activities to the chagrin of Vietnam and other claimants.

Vietnam's prime minister praised its close friendship with India Saturday during the visit ─ the first by an Indian premier in 15 years and part of New Delhi's "Act East Policy" to strengthen economic and security ties with east Asian neighbours.

"(We) discussed matters concerning the East Sea," Vietnamese Prime Minister Nguyen Xuan Phuc told reporters.

"All sides must peacefully solve East Sea disputes based on international laws," he added of the contested waterway, where the Philippines, Brunei, Taiwan and Malaysia also have claims.

The latest defence deal follows a similar announcement in 2014 when India agreed to give Vietnam a $100 million line of credit to buy naval patrol boats, a move that likely rankled China.

Beijing has previously criticised India's cooperation with Vietnam in the defence sector, and India has its own frosty history with China following a brief but bloody border war in 1962.

Friends in the region

Vietnam was the eighth largest importer of arms between 2011 and 2015, according to the Stockholm International Peace Research Institute, up from a rank of 43 in the previous five-year period.

The communist country is increasingly looking to new partners to replace or update Soviet-era military equipment, including the United States which lifted a Cold War-era arms embargo in May.

Vietnam expert Carl Thayer said Modi's trip was Vietnam's way of showing it has other friends in the region.

"Vietnam is playing that game: 'Come on, China, get close to us, cooperate, but if you don't we can move to India or we'll go talk to you after the prime minister of India has just been through,' " he said.

India and Vietnam signed a dozen agreements in all, including a $5 million deal to build a technology park in the coastal resort city of Nha Trang.

Vietnam is pushing to become a key player in Southeast Asia's tech scene as it looks to diversify exports beyond manufacturing and agriculture.

Modi also visited the tomb of Vietnam's independence leader and communist crusader Ho Chi Minh, posting a photo on Twitter of the monument where the embalmed national hero is on display, saying:

"Paid tributes to one of Asia's tallest leaders, the great Ho Chi Minh."

Modi is scheduled to fly out later Saturday to attend the G20 summit in Hangzhou China along with other world leaders.

He will then head to Laos for a summit of the Association of Southeast Asian Nations (ASEAN), and will attend an ASEAN-India Summit on September 8.