President Xi Jinping told his Vietnamese counterpart, Truong Tan Sang, that both sides should demonstrate their determination to forge a political solution to their territorial dispute in the South China Sea.

Xi said the two countries should ensure their relationship does not veer off the right track.

"China and Vietnam must both act in a spirit of responsibility towards history and their people, put the broader picture of Sino-Vietnam friendship and bilateral development first, make up their minds to ... push for a political resolution to the South China Sea issue and prevent it from affecting ties," Xinhua quoted Xi as saying.

It was their first meeting since Xi became president in March.

Xi said Beijing would work with Hanoi in pushing their negotiation progress over demarcating waters outside the Gulf of Tonkin. But he reiterated China's stance that disputes in the South China Sea should be resolved directly between the claimants and rejected outside involvement.

Sang said both countries should work together in maintaining maritime peace and stability, so that it would not affect bilateral relations. "The two countries have a deep traditional friendship, and this is a treasure for the two peoples to cherish."

After their meeting, both sides signed several agreements, including one strengthening strategic co-operation and another on Chinese banks providing low-interest loans to Vietnamese firms.

The Associated Press said the countries' agriculture ministers also signed an agreement to set up a hotline to resolve fishing incidents in the South China Sea.

Sang's delegation, which includes Deputy Prime Minister Nguyen Thien Nhan, is also planning a visit to Guangdong.

Professor Mark Thompson, director of the University of Hong Kong's Southeast Asia Research Centre, said Vietnam was in a dilemma. "On the one hand, the leadership wants to be close to China, but on the other hand they're worried about the reaction of their domestic audience."

If the leadership was perceived as being too appeasing towards Beijing, popular discontent and protests might pose a threat to the Vietnamese regime, Thompson said. But Hanoi might also be looking to China for a developmental role model for its own industrialisation.

Dr Yang Danzhi , a researcher at the Chinese Academy of Social Sciences' Institute of Asia-Pacific Studies, said he believed Vietnam might be part of a larger geopolitical balancing act.

"We should understand China-Vietnam relations under the context of great power relations," Yang said. "Many countries are waiting for middle powers like Vietnam to adjust their policies accordingly. It's a domino effect."

South China Morning Post with Reuters & Associated Press - June 20, 2013