The United States has been physically invaded on several occasions: once during the War of 1812; once during the Mexican–American War; several times during the Mexican Border War; and three times during World War II, two of which were air attacks on American soil. During the Cold War, most of the US military's strategy was geared towards repelling an attack against NATO allies in Europe by the Warsaw Pact.
18th and 19th centuries
The military history of the United States began with a foreign power on US soil: the British Army during the American Revolutionary War. After American independence, the next attack on American soil was during the War of 1812, also with Britain, the first and only time since the end of the Revolutionary War in which a foreign power occupied the American capital (also, the capital city of Philadelphia was captured by the British during the Revolutionary War).
On April 25, 1846, in violation of the Treaties of Velasco, Mexican forces invaded Brownsville, Texas, which they had long claimed as Mexican territory, and attacked US troops patrolling the Rio Grande in an incident known as the Thornton Affair, which sparked the Mexican–American War. The Texas Campaign remained the only campaign on American soil, and the rest of the action in the conflict occurred in California and New Mexico, which were then part of Mexico, and in the rest of Mexico.
The American Civil War may be seen as an invasion of home territory to some extent since both the Confederate and the Union Armies made forays into the other's home territory. One infamous foreign attack on American soil that occurred during the Civil War was the Chesapeake Affair on December 7, 1863, when pro-Confederate British sympathizers from both Nova Scotia and New Brunswick hijacked the American steamer Chesapeake off the coast of Cape Cod, Massachusetts, killing a crew member and wounding three others. The intent of the hijacking was to use the ship as a blockade runner for the Confederacy under the belief that they had an official Confederate letter of marque. The perpetrators had planned to recoal at Saint John, New Brunswick, and head south to Wilmington, North Carolina, but since they had difficulties at Saint John, they sailed farther east and recoaled in Halifax, Nova Scotia. US forces responded to the attack by trying to arrest the captors in Nova Scotian waters. All of the Chesapeake hijackers escaped extradition and justice through the assistance of William Johnston Almon, a prominent Nova Scotian and Confederate sympathizer.
After the Civil War, the threat of an invasion from a foreign power was small, and it was not until the 20th century that any real military strategy was developed to address the possibility of an attack on America.
Mexico in the 1910s
During the Mexican Revolution and more locally the Mexican Border War, in the summer of 1915, Mexican and Tejano rebels covertly supported by the Mexican Government of Venustiano Carranza, attempted to execute the Plan of San Diego by reconquering Arizona, New Mexico, California, and Texas and creating a racial utopia for Native Americans, Mexican Americans, Asian Americans, and African Americans. The plan also called for ethnic cleansing in the reconquered territories and the summary execution of all white males over the age of sixteen. In order to implement the Plan, the rebels set off the Bandit War and conducted violent raids into Texas from across the Mexican border. Under pressure from his advisors to appease Carranza, U.S. President Woodrow Wilson recognized the latter as leader of Mexico in return for Carranza's "help" in suppressing the Texas border raids.
On March 9, 1916, Mexican revolutionary Pancho Villa and his Villistas retaliated for the Wilson Administration's support of Carranza by invading Columbus, New Mexico in the Border War's Battle of Columbus, triggering the Pancho Villa Expedition in response, led by Major General John J. Pershing.
When it was captured and leaked to the American press by British Intelligence, the Imperial German Foreign Office's offer in the Zimmermann Telegram to support Carranza's expansionist aims, as laid out in the Plan of San Diego, in return for a potential wartime alliance against the United States, led the U.S. to declare war on Imperial Germany and enter World War I on the Allied side.
War Plan Green was drafted in 1918 to plan for another war with Mexico, although the ability of the Mexican Army to attack and occupy American soil was considered negligible.