China and Vietnam have signed an agreement to manage a sometimes bitter dispute over the South China Sea.
The deal outlines a series of measures, including a hotline to deal with emergencies and a provision for authorities from both countries to meet twice a year.
This agreement comes after months of tension.
The South China Sea potentially holds vast oil and gas reserves, and is an important shipping route.
Any final agreement on maritime borders should be based on international law, the deal says - and be acceptable to both sides.
There should also be more co-operation in the South China Sea, on such things as scientific research.
These are fine words - but they might be difficult to put into practice.
The two sides have argued repeatedly this year over who has sovereignty over this contentious body of water.
Ships from the two counties clashed a few months ago - and there were anti-China demonstrations in Hanoi.
The dispute over sovereignty involves a number of nations - not just China and Vietnam.
Getting them all to agree on who owns what will not be easy.