HANOI: India said Saturday it is giving Vietnam half a billion dollars in credit to boost defense 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 modernize its military arsenal amid territorial disputes with Beijing in the strategically vital waterway.

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

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 percent 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 neighbors.

“(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 defense 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 criticized India’s cooperation with Vietnam in the defense sector, and India has its own frosty history with China following a brief but bloody border war in 1962.