Updated

China and Vietnam said Wednesday they're committed to negotiating maritime disputes to avoid a recurrence of tensions that spiked when China deployed an oil rig in waters claimed by Hanoi.

The statement followed talks between Chinese President Xi Jinping and Vietnamese special envoy Le Hong Anh to resolve a crisis in relations dating from the rig's deployment in May.

China's move triggered fury in Hanoi, but Beijing rejected Vietnamese complaints and pulled the rig out on its own terms in July.

The friendship between China and Vietnam was created and nourished by older generations of leaders, state broadcaster CCTV quoted Xi as saying. "While clashes are inevitable between neighbors, what's crucial is how they are handled and what kind of attitude is taken," he said.

China's official Xinhua News Agency said the sides would work toward a mutually acceptable and durable solution.

They also agreed to research joint development in the disputed area of the South China Sea, not take actions to complicate or broaden the dispute, and to "maintain the stability of the overall China-Vietnam relationship and of the South China Sea," Xinhua said.

China attacked Vietnam in 1979 to punish it for invading Cambodia and the two have since fought over island groups in the South China Sea. They settled their land border more than a decade ago, but remain at odds over their maritime claims.

This summer's feuding was the worst in years, leading vessels from both nations to spar close to the rig and setting off deadly anti-Chinese riots across Vietnam.

Anti-Chinese sentiment is widespread in Vietnam, and is often tapped into by the country's dissident movement, which criticizes the government for its allegedly subservient relationship to its Communist brethren next door.

The tensions led to speculation that Hanoi might swing relations in favor of its old adversary the United States, as have other Southeast Asian nations locked in territorial disputes with China.

However, the government was seen as split between those favoring a strategic shift to Washington and a faction believing that China, its ideological ally, giant neighbor and vital economic partner, can be accommodated.