A court in The Hague has ruled that China has no historic legal rights over the waters of the South China Sea. In a move that has infuriated Beijing, the ruling marks the first legal decision over the waters that hold some of the world's most promising oil and gas fields and vital fishing grounds.

The ruling came from the Permanent Court of Arbitration at The Hague on Tuesday, with judges deciding China has no historic control over the South China Sea and that the country has breached the Philippines' sovereign rights with its actions.

China, which boycotted the hearings, vowed again to ignore the ruling and said its armed forces would defend its sovereignty and maritime interests.

The case, brought by the Philippines in 2013, hinged on the legal status of reefs, rocks and artificial islands in the Scarborough Shoal and Spratly Island group. Manila's 15-point case also asked the tribunal to rule on the status of the nine-dash line, a boundary that is the basis for China's claim to roughly 85 percent of the South China Sea.

China claims most of the energy-rich waters through which about $5 trillion in ship-borne trade passes every year. Neighbors Brunei, Malaysia, the Philippines, Taiwan and Vietnam also have claims.

The panel sided towards Manila saying there was no legal basis for China to claim for historic rights to resources within the nine-dash line. It said China had interfered with traditional Philippine fishing rights at Scarborough Shoal, one of the hundreds of reefs and shoals dotting the sea, and had breached the Philippines' sovereign rights by exploring for oil and gas near the Reed Bank, another feature in the region.

None of China's reefs and holdings in the Spratly Islands entitled it to a 200-mile exclusive economic zone, the court added.

"The award is a complete and total victory for the Philippines ... a victory for international law and international relations," said Paul Reichler, lead lawyer for the Philippines.

China's Foreign Ministry comprehensively rejected the ruling, saying its people had more than 2,000 years of history in the South China Sea, that its islands did have exclusive economic zones and that it had announced to the world its "dotted line" map in 1948.

"China's territorial sovereignty and maritime rights and interests in the South China Sea shall under no circumstances be affected by those awards. China opposes and will never accept any claim or action based on those awards," it said.

However, the ministry also repeated that China respected and upheld the freedom of navigation and overflight and that China was ready to keep resolving the disputes peacefully through talks with states directly concerned.

Chinese Foreign Minister Wang Yi said the case had been a farce from beginning to end and put the dispute into dangerous territory of worsening tensions and confrontation.

But Wang, in comments carried by state media, struck a more conciliatory tone too, saying the time had now come to put things back on the right track and noting the new Philippine government's sincerity in taking steps to demonstrate its willingness to improve ties.

China's Defense Ministry put out a bilingual Chinese and English statement just before the ruling was made public, saying that the armed forces would "firmly safeguard national sovereignty, security and maritime interests and rights, firmly uphold regional peace and stability, and deal with all kinds of threats and challenges."

Shortly before the ruling was announced, China's state-run Xinhua news agency said a Chinese civilian aircraft successfully carried out calibration tests on two new airports in the disputed Spratly Islands.

In another show of its unwavering views, the defense ministry announced that a new guided missile destroyer was formally commissioned at a naval base on the southern island province of Hainan, which has responsibility for the South China Sea.

The news of the ruling quickly picked up on social media in the Philippines, with the use of the term "Chexit" spreading fast, referring to the public's desire for Chinese vessels to leave the waters.

Vietnam said it welcomed the ruling. Taiwan, which had maintained the island it occupies, Itu Aba, is legally the only island among the hundreds of reefs, shoals and atolls scattered across the seas, said it did not accept the ruling, which had seriously impaired Taiwan's territorial rights.

The ruling also said China had caused permanent harm to the coral reef ecosystem in the Spratlys, charges China has always rejected.

While the arbitration court has no power of enforcement, a victory for the Philippines could spur Taiwan, Vietnam, Malaysia and Brunei to file similar cases.