The military history of the Philippines is characterized by wars between Philippine kingdoms and its neighbors in the precolonial era and then Spanish and American era, and then occupation by the Empire of Japan during World War II and participation in Asian conflicts post-World War II such as the Korean War and the Vietnam War. The Philippines has also battled a communist insurgency and a secessionist movement by Muslims in the southern portion of the country.

Prehistoric period (before 1000 BC – 900 AD) Negritos were among the archipelago's earliest inhabitants, descendants of the first human migrations out of Africa via the coastal route along southern Asia to the now sunken landmasses of Sundaland and Sahul area around 48,000 to 5000 BC. The first Austronesians reached the Philippines at around 2200 BC, settling the Batanes Islands and northern Luzon. From there, they rapidly spread downward to the rest of the islands of the Philippines. They assimilated earlier Negritos that arrived during the Paleolithic, resulting in the modern Filipino ethnic groups that all display various ratios of genetic admixture between Austronesian and Negrito groups.

By 1000 BC, the inhabitants of the Philippine archipelago had developed into four distinct kinds of peoples: tribal groups, such as the Aetas, Ilongots and the Mangyan who depended on hunter-gathering and were concentrated in forests; warrior societies, such as the Isneg and Kalinga who practiced social ranking and ritualized warfare and roamed the plains; the petty plutocracy of the Ifugao Cordillera Highlanders, who occupied the mountain ranges of Luzon; and the harbor principalities of the estuarine civilizations such as the Tagalogs, Visayans, Taūsugs, Maranaos and the Maguindanaons that grew along rivers and seashores while participating in trans-island maritime trade. It was also during the first millennium BC that early metallurgy was said to have reached the archipelagos of maritime Southeast Asia via trade with India.

Pre-colonial period (900 AD to 1565)

Ma-i and Bruneian alliance against China

By the 800s, British Historian Robert Nicholl citing Arab chronicler Al Ya'akubi, had written that on those years, the kingdoms of Muja (Then Pagan Brunei/Vijayapura) and Mayd (Ma-i) waged war against the Chinese Empire.

Kedatuan of Madja-as against Chola Occupied Srivijaya In the aftermath of the Indian Chola invasion of Srivijaya (1025 AD), Datu Puti led some dissident datus from Borneo (including present day Brunei which then was the location of the Vijayapura state which was a local colony of the Hindu-Buddhist Srivijaya empire) and Sumatra in a rebellion against Rajah Makatunao, who was a Chola-appointed local rajah. This oral legend of ancient Hiligaynons rebelling against Rajah Makatunao have corroboration in Chinese records during the Song dynasty when Chinese scholars recorded that the ruler during a February 1082 AD diplomatic meeting, was Seri Maharaja, and his descendant was Rajah Makatunao and was together with Sang Aji (grandfather to Sultan Muhammad Shah).The Pre-Islamic Kings of Brunei By Rozan Yunos taken from the Magazine "Pusaka" published on year 2009. According to the Maragtas the dissidents against new Rajah's rule and their retinue, tried to revive Srivijaya in a new country called Madja-as in the Visayas islands (an archipelago named after Srivijaya) in the Philippines. Seeing how the actual Srivijayan Empire reached even the outer coast of Borneo, which is already neighboring the Philippines, Historian Robert Nicholl implied that the Srivijayans of Sumatra, Vijayans of Vijayapura at Brunei-Sarawak, and the Visayans in the Philippines were all related and connected to each other since they form one contiguous area.

According to Augustinian Friar, Rev. Fr. Santaren, Datu Macatunao or Rajah Makatunao is the "sultan of the Moros," and a relative of Datu Puti who seized the properties and riches of the ten datus. Robert Nicholls, a historian from Brunei identified Rajah Tugao, the leader of the Malano Kingdom of Sarawak, as the Rajah Makatunao referred to in the Maragtas. The Bornean warriors Labaodungon and Paybare, after learning of this injustice from their father-in-law Paiburong, sailed to Odtojan in Borneo where Makatunaw ruled. Using local soldiers recruited from the Philippines as well as fellow pioneers, the warriors sacked the city, killed Makatunaw and his family, retrieved the stolen properties of the 10 datus, enslaved the remaining population of Odtojan, and sailed back to Panay. Labaw Donggon and his wife, Ojaytanayon, later settled in a place called Moroboro. Afterwards there are descriptions of various towns founded by the datus in Panay, other Visayan islands, and southern Luzon.Mga Maragtas ng Panay: Comparative Analysis of Documents about the Bornean Settlement Tradition By Talaguit Christian Jeo N.

Champa-Sulu War The Chams who migrated to Sulu were called Orang Dampuan.History of the Philippines. Chapter 3: Our Early Ancestors.UNDERSTANDING HISTORY. The Champa civilization and the port-kingdom of Sulu engaged in commerce with each other which resulted in merchant Chams settling in Sulu where they were known as Orang Dampuan from the 10th to 13th century. The Orang Dampuan were slaughtered by envious native Sulu Buranuns due to the wealth of the Orang Dampuan. The Buranun were then subjected to retaliatory slaughter by the Orang Dampuan. Harmonious commerce between Sulu and the Orang Dampuan was later restored. The Yakans were descendants of the Taguima-based Orang Dampuan who came to Sulu from Champa. Sulu received civilization in its Indic form from the Orang Dampuan.

Visayan raids against China

Antecedent to these raids, sometime between A.D. 1174 and 1190, a traveling Chinese government bureaucrat Chau Ju-Kua reported that a certain group of "ferocious raiders of China's Fukien coast" which he called the "Pi-sho-ye", believed to have lived on the southern part of Formosa.

In A.D. 1273, another work written by Ma Tuan Lin, which came to the knowledge of non-Chinese readers through a translation made by the Marquis D'Hervey de Saint-Denys, gave reference to the Pi-sho-ye raiders, thought to have originated from the southern portion of Formosa. However, the author observed that these raiders spoke a different language and had an entirely different appearance (presumably when compared to the inhabitants of Formosa). Some scholars have put forth the theory that the Pi-sho-ye were actually people from the Visayas islands. Furthermore, Boholano oral legends say that people from the Kedatuan of Dapitan were the ones that lead the raids on China.

Pon-i Invasion of Philippine Kingdoms During the 12th century, then-Hindu Brunei called "Pon-i", as reported in the Chinese annals Nanhai zhi, invaded Malilu 麻裏蘆 (present-day Manila) as it also administered Sarawak and Sabah, as well as the Philippine kingdoms Butuan, Sulu, Ma-i (Mindoro), Shahuchong 沙胡重 (present-day Siocon), Yachen 啞陳 (Oton), and 文杜陵 Wenduling (present-day Mindanao). Manila regained independence.Reading Song-Ming Records on the Pre-colonial History of the Philippines By Wang Zhenping Page 256.

War between Sulu and Majapahit In the mid 14th century, the Majapahit empire mentioned in its manuscript Nagarakretagama Canto 14, written by Prapanca in 1365, that the area of Solot (Sulu) was part of the empire. Nagarakretagama was composed as a eulogy for their emperor Hayam Wuruk. However, Chinese sources then report that in 1369, the Sulus regained independence and in vengeance, assaulted Majapahit and its province, Po-ni (Brunei) which Majapahit invaded, looting it of treasure and gold. A fleet from the Majapahit capital succeeded in driving away the Sulus, but Po-ni was left weaker after the attack and the Majapahit collaborating Pon-i royalty have to deal with the theft of two sacred pearls by Sulu. The Majapahit Empire, attempted to reconquer the kingdoms of Sulu and Manila but they were permanently repulsed. Furthermore, the Sulus counter-invaded deep into Majapahit held East Kalimantan and North Kalimantan

War between the Moros and Cebu

During the early 1400s, Rajamuda Sri Lumay, a Chola dynasty prince who rebelled against the Cholas and sided with his Malay subjects established an independent Tamil-Malay Indianized kingdom in Cebu called the Rajahnate of Cebu, he established his country by waging scorched earth tactics against raiders from Mindanao. War between the Muslims and Cebu lasted until the Spanish era.

Brunei's invasion of Tondo, incorporation of Sulu and establishment of Manila The Battle of Manila (1500s) was fought in Manila between citizens of the Kingdom of Tondo led by their Lakan, Sukwu and the soldiers of the Sultanate of Brunei led by Sultan Bolkiah the singing captain. The aftermath of the battle was the formation of an alliance between the newly established Kingdom of Maynila (Selurong) and the Sultanate of Brunei, to crush the power of the Kingdom of Tondo and the subsequent installation of the Pro-Islamic Rajah Sulaiman into power. Furthermore, Sultan Bolkiah's victory over Sulu and Seludong (modern day Manila), as well as his marriages to Laila Mecanai the daughter of Sulu Sultan Amir Ul-Ombra (an uncle of Sharifa Mahandun married to Nakhoda Angging or Maharaja Anddin of Sulu), and to the daughter of Datu Kemin, widened Brunei's influence in the Philippines.

Territorial conflict between Manila and Tondo According to the account of Rajah Matanda as recalled by Magellan expedition members Gines de Mafra, Rodrigo de Aganduru Moriz, and expedition scribe Antonio Pigafetta, Maynila had a territorial conflict with Tondo in the years before 1521.

At the time, Rajah Matanda's mother (whose name was not mentioned in the accounts) served as the paramount ruler of the Maynila polity, taking over from Rajah Matanda's father (also unnamed in the accounts), who had died when Rajah Matanda was still very young. Rajah Matanda, then simply known as the "Young Prince" Ache, was raised alongside his cousin, who was ruler of Tondo – presumed by some to be a young Bunao Lakandula, although not specifically named in the accounts.

During this time, Ache realized that his cousin, who was ruler of the Tondo polity, was "slyly" taking advantage of Ache's mother by taking over territory belonging to Maynila. When Ache asked his mother for permission to address the matter, his mother refused, encouraging the young prince to keep his peace instead. Prince Ache could not accept this and thus left Maynila with some of his father's trusted men, to go to his "grandfather", the Sultan of Brunei, to ask for assistance. The Sultan responded by giving Ache a position as commander of his naval force.

In 1521, Prince Ache was coming fresh from a military victory at the helm of the Bruneian navy and was supposedly on his way back to Maynila with the intent of confronting his cousin when he came upon and attacked the remnants of the Magellan expedition, then under the command of Sebastian Elcano. Some historiansJose Rizal, as cited by Dery, 2001 suggest that Ache's decision to attack must have been influenced by a desire to expand his fleet even further as he made his way back to Lusong and Maynila, where he could use the size of his fleet as leverage against his cousin, the ruler of Tondo.

Battle of Mactan

The Battle of Mactan on April 27, 1521, is celebrated as the earliest reported resistance of the natives in the Philippines against western invaders. Lapu-Lapu, a Chieftain of Mactan Island, defeated Christian European explorers led by the Portuguese navigator Ferdinand Magellan.