Vietnam coastguard
A crewman from a Vietnamese coastguard ship surveys Chinese coastguard vessels   Reuters

China's President Xi Jinping has sought to mend ties with Vietnam as officials from Hanoi visited Beijing, according to China's state news agency Xinhua.

Xi told a special envoy from Vietnam that the two countries should be "friendly to each other", months after a violent flare up over disputed territory in the South China Sea.

Le Hongh Anh, a member of the Vietnamese Communist Party's politburo, visited Beijing as the two sides showed willingness to mend ties.

"I hope the Vietnamese will make joint efforts with the Chinese to put the bilateral relationship back on the right track of development," Xi told Le Hongh, as cited by Xinhua.

"A neighbour cannot be moved away and it is in the common interests of both sides to be friendly to each other," he said, as quoted by the state news agency.

Ships from the two sides clashed in the South China Sea close to the Paracel chain of islands in May, after China deployed a massive oil rig in the vicinity. Both Beijing and Hanoi are laying claims to the islands and surrounding waters.

The maritime spat led to clashes on mainland Vietnam, where rioters mistakenly torched Taiwanese factories as they thought they were attacking Chinese businesses. The riots led to more than 20 people being killed and caused millions of dollars' worth of damage.

Trade between the two countries is worth around $50bn annually.

Le Hongh had earlier met with Liu Yunshan, a member of China's elite politburo. The two parties reached an agreement to implement a basic guideline for the resolution of the maritime issues, Xinhua reported.

Hanoi and Beijing agreed to study joint exploration options in the South China Sea and seek lasting solutions acceptable to both sides, the state news agency reported.