Vietnam and China, despite differences over their competing territorial claims in the South China Sea, agreed to improve cooperation between their coast guards and better manage their maritime disputes.

The countries signed a memorandum of understanding on Monday, Vietnam’s Ministry of Foreign Affairs said, during a visit to Hanoi by Chinese State Councilor Yang Jiechi.

“The two sides agreed that there is a need to promote friendly and comprehensive cooperation,” the ministry said following a meeting between Mr. Yang and Vietnamese Foreign Minister Pham Binh Minh.

Mr. Yang’s visit came ahead of a closely watched verdict by an international tribunal in The Hague on China’s claims over the South China Sea. Beijing has boycotted the proceedings and has said it will ignore the tribunal’s ruling.

Monday’s agreement also follows a visit to Vietnam last month by U.S. President Barack Obama, who has sought to court Hanoi amid its standoff with Beijing. Mr. Obama lifted a longstanding U.S. arms embargo on Vietnam and has moved to normalize relations between the former foes, capitalizing on Hanoi’s unease over China’s military buildup in the region.

Vietnam’s foreign ministry said the two officials discussed maritime issues, stressing the importance of not letting disputes escalate. China’s construction of artificial islands in disputed waters of the South China Sea has alarmed several of its smaller neighbors who also claim territory there.

Vietnam also announced that it will allow China to open a consulate in the central coastal city of Da Nang.

By Vu Trong Khanh - The Wall Street Journal - June 28, 2016