The Philippines occupies Second Thomas Shoal but China also claims it, and increasingly hostile clashes at sea have sparked fears of larger conflicts that could involve the United States.
The crucial deal was reached on Sunday, after a series of meetings between Philippine and Chinese diplomats in Manila and exchanges of diplomatic notes that aimed to establish a mutually acceptable arrangement at the shoal without conceding either side's territorial claims.
Two Philippine officials, who have knowledge of the negotiations, confirmed the deal to The Associated Press and the government later issued a brief statement announcing the deal without providing details.
"Both sides continue to recognise the need to de-escalate the situation in the South China Sea and manage differences through dialogue and consultation and agree that the agreement will not prejudice each other's positions in the South China Sea," the Department of Foreign Affairs in Manila said.
China has disputes with several governments over land and sea borders, many of them in the South China Sea, and the rare deal with the Philippines could spark hope that similar arrangements could be forged by Beijing with other rival countries.
Chinese coastguard and other forces have used powerful water cannons and dangerous blocking manoeuvres to prevent food and other supplies from reaching Filipino navy personnel at Manila's outpost at the shoal.
The years-long territorial standoff has flared repeatedly since last year between Chinese coastguard, navy and suspected militia ships and Philippine coastguard-escorted navy boats transporting food, water and fresh navy and marine personnel to an outpost on a long-grounded warship, the BRP Sierra Madre.
In the worst confrontation, Chinese forces on motorboats repeatedly rammed and then boarded two Philippine navy boats on June 17 to prevent Filipino personnel from transferring food and other supplies including firearms to the ship outpost, according to the Philippine government.
After repeated ramming, the Chinese seized the Philippine navy boats and damaged them with machetes and improvised spears. They also seized seven M4 rifles, which were packed in cases, and other supplies.
The violent clash wounded several Filipino navy personnel, including one who lost his thumb, in a chaotic skirmish that was captured in video and photos that were later made public by Philippine officials.
The United States and its key Asian and Western allies, including Japan and Australia, condemned the Chinese acts at the shoal and called for the rule of law and freedom of navigation to be upheld in the South China Sea.
One of the two Philippine officials said the June 17 confrontation prompted Beijing and Manila to hasten on-and-off talks on an arrangement that would prevent confrontations at Second Thomas Shoal.