China and Vietnam pledged on Wednesday to rein in maritime tensions during the highest-level direct contact between the countries since relations worsened in May over a Chinese oil rig operating in the South China Sea.

Analysts welcomed the talks, but stressed that tangible progress can be made only after Vietnam stops harassing Chinese vessels.

State Councilor Yang Jiechi told Vietnamese Deputy Prime Minister Pham Binh Minh the countries should stabilize the situation as soon as possible through political and diplomatic efforts.

"We should also try not to exaggerate, complicate and internationalize the issue," Yang said.

Yang, China's top diplomat, outranking the foreign minister, was in Hanoi for an annual meeting.

Before leaving in the evening, he also met with Vietnamese Prime Minister Nguyen Tan Dung and Communist Party of Vietnam General Secretary Nguyen Phu Trong.

Vietnam should be held responsible for "the difficult situation" in relations, Yang told Minh, who is also foreign minister.

Yang stressed that the Xisha Islands are an inherent part of Chinese territory, adding that Beijing will "take any necessary measures" to protect its sovereignty and maritime interests.

The rig's operational area was 31 km from the baseline of the Xisha Islands' territorial waters and between 246 km and 289 km from the Vietnamese coast.

In the past month, Vietnamese vessels had rammed Chinese ships safeguarding the rig 1,547 times as of Friday, Beijing said. Yang urged Vietnam to stop harassing Chinese vessels and to ensure the security of Chinese citizens in the country.

Both countries said they cherish their long-established ties and are willing to improve relations.

Minh said Hanoi is willing to work with Beijing to show the two neighbors are "capable of solving disputes peacefully".

Ruan Zongze, vice-president of the China Institute of International Studies, said Hanoi has to build consensus first and show its determination to solve the problem.

The meetings came as US President Barack Obama's nominee to become the next US ambassador to Vietnam said on Tuesday it may be time for Washington to consider lifting a ban on the sale and transfer of lethal weapons to Hanoi.

Ted Osius said, "There's really no better time than this year, given the Vietnamese interest in a deepening partnership with us."

Chinese Foreign Ministry spokeswoman Hua Chun-ying said on Wednesday that any relationship between two countries "should not target third parties".

But Ruan said, "The United States and Vietnam will not get too close in the short term, given their entangled history."

Jia Yu, deputy head of the China Institute for Marine Affairs, said if Washington is really concerned about navigational freedom as it claims, it should first ask Hanoi to clear obstacles, including large fishing nets, that it has placed around the Chinese oil rig.