The Association of Southeast Asian Nations (ASEAN) and China have agreed to begin talks on regional guidelines for the South China Sea in a major breakthrough over the long-disputed territory.

In a statement issued late on Monday, Robespierre Bolivar, spokesman of the Philippine Department of Foreign Affairs, said the neighbouring countries would "commence the negotiations on a substantive and effective code of conduct" based on a framework established in August.

Leaders of ASEAN - as well as powers such as the United States, China, Japan, and India - have been meeting in Manila over the last two days.

For 15 years, the 10-member ASEAN bloc has struggled to reach a deal with its dominant neighbour, China, leading to several diplomatic skirmishes over disputed islands and territory in the resource-rich area.

Bolivar did not say when the talks would begin, but he said the Philippines would issue a separate statement regarding the agreement.

A draft statement released to the media said, "While the situation is calmer now, we cannot take the current progress for granted."

The statement said it is "important that we cooperate to maintain peace, stability, freedom of navigation in and over-flight above the SCS [South China Sea], in accordance with international law".

"It is in our collective interest to avoid miscalculations that could lead to escalation of tensions."

China claims most of the South China Sea, one of the busiest shipping routes in the world. ASEAN member nations Malaysia, the Philippines, Vietnam, and Brunei, as well as Taiwan also claim overlapping parts of the area.

A code of conduct would serve as a guideline for the competing claimants on how their sea vessels and aircraft can pass through the territory without dispute.

'Peace over confrontation'

Philippine President Rodrigo Duterte, who hosted the 50th ASEAN summit, said instead of highlighting the region's differences with China, the countries should "be friends".

"The other hotheads would like us to confront China and the rest of the world on so many issues," he said during one of the ASEAN events on Sunday.

"The South China Sea is better left untouched; nobody can afford to go to war. It can ill afford a violent confrontation."

Duterte's predecessor, Benigno Aquino, had accused China of building "illegal" structures and reclaiming sandbars in the middle of South China Sea, igniting a long-standing diplomatic face-off between Manila and Beijing.

In July 2016, an international tribunal in The Hague ruled in favour of the Philippines in that territorial dispute with China.

But Duterte downplayed the ruling and said the Philippines could not afford to go to war with its more powerful neighbour.

It was also revealed recently that the Philippine and Chinese navies had another confrontation over structures built by Manila on one of the islands within its exclusive economic zone.

Duterte, however, ordered the Philippine military to "pull out" of the area, prompting his critics to say he was sacrificing the country's sovereignty.

Separately, Vietnam and China were also involved in a tense standoff over the Paracels Islands and Johnson Reef.

On Monday, during the opening of the ASEAN summit, Duterte skirted the South China Sea issue and instead focused on the rise of "terrorism and violent extremism" in the region.

"Terrorism and violent extremism endanger the peace, stability, and security of our region because these threats know no boundary," he said.

"Piracy and armed robbery in the seas put a dent on our growth and disrupt the stability of both regional and global commerce. The menace of the illegal drug trade continues to endanger the very fabric of our society."