Vietnam and China agreed Monday to back away from conflicts in the South China Sea, in a move aimed at easing tensions over Beijing's claims to most of the waterway.
The communist neighbours have long-sparred over the sea -- to which Brunei, Taiwan and the Philippines also have partial claims -- through which $5 trillion in shipping trade passes annually.
China has built artificial islands and airstrips capable of hosting military installations in the sea, which is believed to sit atop vast oil and gas deposits.
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 sea.
Tensions flared earlier this year when Vietnam suspended an oil exploration project in an area off its coast that China claims as its own, reportedly following pressure from Beijing.
Relations hit rock bottom in 2014 when Beijing moved an oil rig into waters claimed by Vietnam, sparking weeks of protests.
On Sunday US President Donald Trump offered to use his negotiation prowess 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.
But on Monday, China appeared to take a swipe at his offer.
"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,"
Chinese foreign ministry spokesman Geng Shuang said at a regular press briefing.
Trump was in Manila Monday for meetings with the 10-member Association of Southeast Asian Nations (ASEAN) and several other countries.
Later Monday China and ASEAN, which includes Vietnam, were expected to announce in Manila that they have agreed to begin talks on a much-delayed code of conduct for the sea.
China insists the code must not be legally binding, a demand to which Southeast Asian countries have so far acquiesced.
Vietnam had been pushing for the code to be legally binding but ASEAN agreed in August that it would not have any legal force.
China agreed in 2002 to begin talks on a code, but has delayed actually doing so while carrying out its expansionist strategy.