Archeological and paleontological theory suggests that Homo sapiens existed in Palawan about 50,000 BC. The Aetas are thought to have arrived in the Philippines more than 30,000 BC through land bridges, possibly from China or the Andaman Islands.
The ancestors of the vast majority of the Filipino people, the Austronesians from Taiwan, settled in northern Luzon around 2500 BC. They spread to the rest of the Philippines and later colonized most of Maritime Southeast Asia and the Western Pacific Islands. Arab, Chinese and Indian traders made contact with the Philippines during the course of the next thousand years until the arrival of the Europeans.
Sailing for the Spanish, the Portuguese explorer Ferdinand Magellan and his crew were the first Europeans to arrive in the archipelago in 1521. Magellan was killed by indigenous warriors in Mactan Island while being involved with political conflicts with Lapu-Lapu. The conquistador, Miguel López de Legazpi arrived from Mexico in 1565 and formed the first Spanish settlements, and paved the way for colonization. In 1571 he established Manila as the capital of the new Spanish colony.
Roman Catholic missionaries converted most of the inhabitants. In the next 333 years, the Spanish military fought off various local indigenous revolts and various external colonial challenges. Such challenges came from the British, Chinese, Dutch, French, Japanese, and Portuguese. The most significant loss for Spain was the temporary occupation of the capital, Manila, by the British during the Seven Years' War. The Philippines was ruled as a territory of New Spain from 1565 to 1821, before it was administered directly from Spain. The Manila Galleon which linked Manila to Acapulco, Mexico traveled once or twice a year, beginning in the late 16th century. The Philippines opened itself to world trade on September 6, 1834.
A propaganda movement, which included Philippine nationalist José Rizal, then a student studying in Spain, soon developed on the Spanish mainland. This was done in order to inform the government of the injustices of the administration in the Philippines as well as the abuses of the friars. In the 1880s and the 1890s, the propagandists clamored for political and social reforms, which included demands for greater representation in Spain. Unable to gain the reforms, Rizal returned to the country, and pushed for the reforms locally. Rizal was subsequently arrested, tried, and executed for treason on December 30, 1896. Earlier that year, the Katipunan, led by Andrés Bonifacio, already started a revolution, which was eventually continued by Emilio Aguinaldo, who established a revolutionary government, although the Spanish governor general Fernando Primo de Rivera proclaimed the revolution over in May 17, 1897. 
The Spanish-American War began in Cuba in 1898 and soon reached the Philippines when Commodore George Dewey defeated the Spanish squadron at Manila Bay. Aguinaldo declared the independence of the Philippines on June 12, 1898, and was proclaimed head of state. As a result of its defeat in the War, Spain ceded the Philippines, together with Cuba, Guam and Puerto Rico to the United States. By 1899, the Philippine-American War ensued between the United States and the Philippine revolutionaries, which continued the violence of the previous years. The US proclaimed the war ended when Aguinaldo was captured by American troops on March 23, 1901, but the struggle continued until 1913. The country's status as a colony changed when it became the Commonwealth of the Philippines in 1935, which provided for more self-governance. Plans for increasing independence over the next decade were interrupted during World War II when Japan invaded and occupied the islands. After the Japanese were defeated in 1945, the Philippines achieved independence from the United States on July 4, 1946.
Since 1946, the newly independent Philippine state has faced political instability with various rebel groups. The late 1960s and early 1970s saw economic development that was second in Asia, next to Japan. Ferdinand Marcos was, then, the elected president. Barred from seeking a third term, Marcos declared martial law on September 21, 1972 and ruled the country by decree. Marcos extended both his power and tenure by force. His authoritarian rule became marred with unmitigated, pervasive corruption, cronyism and despotism.
Opposition leader Benigno Aquino, Jr. was assassinated on August 21, 1983 upon returning from exile. In January 1986, Marcos allowed for a "snap" election, after large protests. The election was believed to be fraudulent, and resulted in a standoff between military mutineers and the military loyalists. Protesters supported the mutineers, and was accompanied by resignations of prominent cabinet officials. Corazon Aquino, the wife of Benigno Aquino, Jr., was the recognized winner of the snap election. She took over government, and called for a constitutional convention to draft a new constitution, after the 1986 EDSA Revolution. Marcos, his family and some of his allies fled to Hawaii.
The return of democracy and government reforms after the events of 1986 was hampered by massive national debt, government corruption, coup attempts, a communist insurgency, and a Muslim separatist movement. The economy improved during the administration of Fidel V. Ramos, who was elected in 1992. However, the economic improvements were negated at the onset of the East Asian financial crisis in 1997. The 2001 EDSA Revolution led to the downfall of the following president, Joseph Estrada. The current administration of president Gloria Macapagal-Arroyo has been hounded by allegations of corruption and election rigging. Due to these allegations the current administration has had to suppress several attempted coups, the most recent taking place in Manila during March of 2006.