Hanoi (AFP) – Vietnam and China agreed Monday to avoid conflicts in the hotly contested South China Sea, as a new pathway to dialogue on easing tensions was opened with other Southeast Asian nations.

The communist neighbours have long sparred over the sea, through which $5 trillion in shipping trade passes annually and which is believed to sit atop vast gas reserves.

Hanoi and Beijing agreed Monday to keep the peace in the sea, the countries said in a joint statement during a state visit to Hanoi by Chinese President Xi Jinping.

They agreed to “well manage disputes at sea, make no moves that may complicate or expand disputes, (and) maintain peace and stability on the East Sea,” the Vietnamese version of the statement said, using Hanoi’s term for the waters.

China claims nearly all of the sea, even approaching the coasts of its neighbours. It is also partly claimed by the Philippines, Malaysia, Brunei and Taiwan in addition to Vietnam.

China has in recent years built artificial islands and airstrips capable of hosting military installations in contested areas to cement its claims, inflaming tensions with its neighbours.

Relations between China and Vietnam hit a low in 2014 when Beijing moved an oil rig into waters claimed by Vietnam, sparking weeks of protests.

There have been two armed conflicts between China and Vietnam in the sea — brief clashes in 1974 and 1988 that claimed the lives of dozens of Vienamese troops.

On Sunday US President Donald Trump offered to help Vietnam resolve the long-simmering tensions.

“If I can help mediate or arbitrate, please let me know… I am a very good mediator,” Trump said on his own state visit to Hanoi at the tail end of his marathon tour of Asia.

Vietnam offered no response.

And China, which has long insisted the United States has no role to play in the dispute, spoke out against what it deemed foreign interference.

“We hope non-regional countries can respect the regional countries’ efforts in maintaining the regional stability of the South China Sea, and play a constructive role in this aspect,” foreign ministry spokesman Geng Shuang said at a regular press briefing in Beijing.

– More talks agreed –

Trump was in Manila on Monday for meetings with the 10-member Association of Southeast Asian Nations (ASEAN) and several other countries.

At that meeting China and ASEAN, which includes Vietnam, announced on Monday night they had agreed to begin talks on a much-delayed code of conduct for the sea.

Chinese Premier Li Keqiang sealed the accord with the ASEAN leaders in Manila, according to China’s state-run Xinhua news agency.

However no timeframe was announced for an actual code.

China initially agreed in 2002 to begin talks on a code, but delayed doing so while carrying out its expansionist strategy.

And at China’s insistence, ASEAN also agreed in August that any future code would not be legally binding, despite a strong push from Vietnam.

After the Philippines backed China’s position, ASEAN agreed it would not have legal force.

The Philippines had for many years stood alongside Vietnam as one of the region’s strongest opponents to Chinese expansionism.

Following Manila’s complaint to a United Nations-backed tribunal, the panel ruled last year that China’s territorial claims in the sea were without legal basis.

But the Philippines, after President Rodrigo Duterte took office last year, decided not to use the ruling to pressure China.

He instead chose to build closer ties in return for billions of dollars in investments and aid.

Critics accused Duterte of giving in to Beijing. But he said his tactics had eased tensions and opened the door to dialogue.

burs-jv-kma/hg/sm