China's expansive assertion of sovereignty over the South China Sea suffered a major blow when an international tribunal ruled that its claims have no legal or historical basis, throwing up the possibility of a new period of tension and confrontation in the region.
Beijing fiercely rejected the decision by the Permanent Court of Arbitration (PCA) in The Hague, which sided unequivocally with the Philippines against China. The United States urged calm.
China's Government has whipped up nationalist sentiment in recent years to support its "indisputable sovereignty" over a huge swath of the South China Sea, and it has engaged in an intensive programme of island-building there to extend its de facto control.
China is now faced with a dilemma: It can signal its displeasure at the ruling by extending that programme and militarising the islands it controls, risking confrontation and even conflict with emboldened Asian neighbours and the United States.
Or it can suspend the programme and adopt a more conciliatory approach, at the risk of a loss of face domestically.
"It's a slap in the face for China," said Shen Dingli, a professor of international relations at Fudan University. "It's a lose-lose situation for China - take action and risk armed confrontation, or, while reiterating its tough stance, stop building and fishing, which is what the ruling asks."
The tribunal also ruled that China had violated the Philippines' sovereign rights by constructing artificial islands and had caused "permanent irreparable harm to the coral reef ecosystem".
The decision was hailed as a landmark victory for those worried that Beijing was extending its military control over waters with key strategic and commercial significance. But Chinese President Xi Jinping signalled that he was in no mood to back down.
"The islands in the South China Sea have been Chinese territories since ancient times," he said, according to state media. "China opposes and will never accept any claim or action based on these awards."
The Foreign Ministry said China "solemnly declares that the award is null and void and has no binding force".
Nor would it be easy for Xi to back down, after making the "great rejuvenation of the Chinese nation" one of his signature slogans, drawing a rhetorical line from its past "humiliation" at the hands of Western colonial powers and Japan to his vision of a strong, proud China under Communist Party rule.
But the verdict will nevertheless undermine Beijing's claim to sovereignty within what it calls the "nine-dash line," which it draws around most of the South China Sea.
The Philippines took China to the PCA in January 2013 after the Chinese Navy seized control of Scarborough Shoal, a largely submerged chain of reefs and rocks amid rich fishing grounds off the Philippine island of Luzon.
The ruling could lead to more friction between China and the United States, with the issue seen as a key test of Washington's ability to maintain its leading role in Asian security in the face of China's rising power.
The State Department said it "hopes and expects" that both China and the Philippines will abide by the ruling. "We urge all claimants to avoid provocative statements or actions," said State Department spokesman John Kirby.
Philippine Foreign Secretary Perfecto Yasay called the ruling a "milestone". But he also urged "restraint and sobriety" on all concerned.
"The verdict is the best-case scenario that few thought possible," said Richard Javad Heydarian, an assistant professor of political science at Manila's De La Salle University.
"It is a clean sweep for the Philippines, with the tribunal rejecting China's nine-dashed line and historical-rights claim as well as censuring its aggressive activities in the area and, among others, the ecological damage caused by its reclamation activity."
In China, Chen Xiangmiao, an assistant research fellow at National Institute for South China Sea Studies, said, "The nine-dash line is the foundation of China's claim to sovereignty activities in the South China Sea, which has been smashed by the ruling. It is highly possible that the Philippines will expand its presence in the South China Sea, which will create conflict."
Beijing refused to participate in the arbitration process and launched a global propaganda campaign. Foreign Minister Wang Yi was quoted as telling Secretary of State John Kerry last week that the case was a "farce". His ministry said it was delusional to think China would bow to diplomatic pressure to accept the ruling.
ABOUT THE SOUTH CHINA SEA
1 Some US$5 trillion in commerce, roughly one-third of global trade, flows through the South China Sea every year
2 Its fisheries account for 12 per cent of the global catch
3 Significant oil and gas reserves are thought to exist under the sea floor
4 The waters are some of the most fiercely disputed in the world
5 Claims to various parts are staked by Brunei, Malaysia, Vietnam, Taiwan, China and the Philippines.
China claims sovereignty over almost all the islands, reefs and rocks in the sea - including those hundreds of kilometres from Chinese shores.
In the past two years, Beijing has turned seven reefs and rocks into nascent military outposts, with airstrips and radar installations under construction.
But the tribunal backed the Philippines' submission that none of those features are islands - as defined by the 1982 United Nations Convention on the Law of the Sea (UNCLOS).
Only natural (rather than artificial) islands that can sustain human habitation qualify for both 12 nautical miles of territorial waters and 200-nautical-mile exclusive economic zones under UNCLOS.
In other words, the ruling drastically undermines China's claim to the waters surrounding the island bases it is building.
China says the tribunal lacked the jurisdiction to rule on Manila's various submissions. Though its decision is legally binding, the court lacks any mechanism to enforce its rulings.
Nevertheless, the outcome of the case will provide an important indication of China's willingness to submit to international law, and of what kind of global power it wants to become.
"This is a breathtaking indictment of China's position in the South China Sea," said David Welch, a global security expert at the Balsillie School of International Affairs in Waterloo, Ontario.
"It will be very difficult for Beijing to pretend that the tribunal's finding does not matter legally, politically or practically. How China reacts over the next days and weeks will essentially determine its international standing for decades."
This is a breathtaking indictment of China's position in the South China Sea
What happens next will depend on how all the key players react.
The US Navy has already conducted several "freedom of navigation" exercises in the South China Sea, sending warships within 12 nautical miles of islands, reefs and rocks controlled by China and other claimants. Washington is also rebuilding military ties with the Philippines. China cites this as evidence that President Barack Obama's actions - not its own island-building - are responsible for militarising the region.
China could attempt to reinforce its position by building a new military base on Scarborough Shoal, a move that would clearly be viewed as dangerously provocative by Washington and Manila.
Paul Reichler, the Philippines' chief counsel in the case, said the ruling was likely to unite all the rival claimants to the waters of the South China Sea against China. "China may face a prolonged period of embittered neighbours and an uncertain, unstable and insecure situation in the South China Sea unless and until it finds a way to accommodate itself to the rule of law as clearly set forth in the arbitral award," he said.
China, which hosts a summit of the Group of 20 major economies in September, may want time to gauge the reaction from Manila, where newly elected President Rodrigo Duterte has sent mixed signals.
Early in his election campaign, Duterte implied he might be willing to soften his stance on China in return for Chinese infrastructure projects on his home island of Mindanao. But he later promised to ride a water scooter to Scarborough Shoal to plant the Philippine flag.