The early inhabitants of Subic were the Negritos of Zambales (more popularly known as Aetas). At the end of the Pleistocene, seafarers from the Malay Peninsula of the Asian mainland sailed to the Southeast Asian islands, establishing pockets of population. The Malays were the first migrants to reach Zambales and drove the Negrito aborigines from the plains and valleys to the mountains. They found themselves at the western coastal plain of Luzon between Subic Bay and Lingayen Gulf.
The town of Subic was founded by the Augustinian Friar, Father Rodrigo de San Miguel in 1607. The Spanish government christianized the Negritos and made them subjects of Spain. However, there were resistance by the Negritos and they continued to defy the government. In 1884, King Alfonso II issued a Royal Decree officially declaring Subic Bay as a naval port and Subic became Spain's stronghold in the Far East.
After the Spanish-American war, which erupted in April 25, 1898, the U.S naval forces took over Subic and its Bay, whose deep harbor was regarded by Admiral George Dewey as having no equal in the Philippine Islands.
In 1901, the U.S. Navy designated Subic Bay as a repair and supply naval base site. U.S. President Theodore Roosevelt issued an executive order in 1903 designating 70,000 acres of land including Subic as an American military reservation because of its strategic importance. Nearly 50% of Subic's original land area became part of the military reservation area.
Subic was in ruins after the Japanese bombers and fighter planes attacked Subic Bay and Olongapo on December 14, 1941. During the Japanese occupation from 1942 to 1945, Subic served as a monitoring and defense facility of the Japanese Imperial Army until the end of World War II. On January 29, 1945, 40,000 troops landed in Zambales and advanced through Subic Bay to regain control of the base.
Olongapo, a barrio of Subic and part of the U.S. Military Reservations was turned over to the Philippines and converted into a municipality by virtue of Executive Order No. 366 issued by then President Carlos P. Garcia in December 7, 1959. Based on census data, this milestone in Subic's history resulted in the drastic reduction of the town's population by more than half, from 25,233 to 12,985 in 1948 and 1960, respectively.