The Permanent Court of Arbitration said there was no evidence that China had historically exercised exclusive control over the waters or resources.
China called the ruling “ill-founded” and says it will not be bound by it.
China claims almost all of the South China Sea, including reefs and islands also claimed by others.
The tribunal in The Hague said China had violated the Philippines’ sovereign rights. It also said China had caused “severe harm to the coral reef environment” by building artificial islands.
China’s Island Factory
Mysteries and maritime claims
In pictures: How the ruling affects the livelihood of Filipino fishermen
Why is the South China Sea contentious?
Flying close to China’s new islands
Rivalries underneath the South China Sea
The ruling came from an arbitration tribunal under the United Nations Convention on the Law of the Sea (UNCLOS), which both countries have signed.
The ruling is binding but the Permanent Court of Arbitration has no powers of enforcement.
The US sent an aircraft carrier and fighter jets to the region ahead of the ruling. Meanwhile, the Chinese Navy has been carrying out exercises near the disputed Paracel islands.