The United States of America was formed after thirteen British colonies in North America declared independence from the British Empire on July 4, 1776. In the Lee Resolution, passed by the Second Continental Congress two days prior, the colonies resolved that they were free and independent states. The union was formalized in the Articles of Confederation, which came into force on March 1, 1781, after being ratified by all 13 states. Their independence was recognized by Great Britain in the Treaty of Paris of 1783, which concluded the American Revolutionary War. This effectively doubled the size of the colonies, now able to stretch west past the Proclamation Line to the Mississippi River. This land was organized into territories and then states, though there remained some conflict with the sea-to-sea grants claimed by some of the original colonies. In time, these grants were ceded to the federal government.
The first great expansion of the country came with the Louisiana Purchase of 1803, which doubled the country's territory, although the southeastern border with Spanish Florida was the subject of much dispute until it and Spanish claims to the Oregon Country were ceded to the US in 1821. The Oregon Country gave the United States access to the Pacific Ocean, though it was shared for a time with the United Kingdom. The annexation of the Republic of Texas in 1845 led directly to the Mexican–American War, after which the victorious United States obtained the northern half of Mexico's territory, including what was quickly made the state of California.
As the development of the country moved west, however, the question of slavery became more important, with vigorous debate over whether the new territories would allow slavery and events such as the Missouri Compromise and Bleeding Kansas. This came to a head in 1860 and 1861, when the governments of the southern states proclaimed their secession from the country and formed the Confederate States of America. The American Civil War led to the defeat of the Confederacy in 1865 and the eventual readmission of the states to the United States Congress. The cultural endeavor and pursuit of manifest destiny provided a strong impetus for westward expansion in the 19th century.
The United States began expanding beyond North America in 1856 with the passage of the Guano Islands Act, causing many small and uninhabited, but economically important, islands in the Caribbean Sea and the Pacific Ocean to be claimed. Most of these claims were eventually abandoned, largely because of competing claims from other countries. The Pacific expansion culminated in the annexation of Hawaii in 1898, after the overthrow of its government five years previously. Alaska, the last major acquisition in North America, was purchased from Russia in 1867. Support for the independence of Cuba from the Spanish Empire, and the sinking of the USS Maine, led to the Spanish–American War in 1898, in which the United States gained Puerto Rico, Guam, and the Philippines, and occupied Cuba for several years. American Samoa was acquired by the United States in 1900 after the end of the Second Samoan Civil War. The United States purchased the U.S. Virgin Islands from Denmark in 1917. Puerto Rico and Guam remain territories, and the Philippines became independent in 1946, after being a major theater of World War II.
Following the war, many islands were entrusted to the U.S. by the United Nations, and while the Northern Mariana Islands became a U.S. territory, the Marshall Islands, Federated States of Micronesia, and Palau emerged from the trust territory as independent nations. The last major international change was the acquisition in 1904, and return to Panama in 1979, of the Panama Canal Zone, an unincorporated US territory which controlled the Panama Canal. The final cession of formal control over the region was made to Panama in 1999.
States have generally retained their initial borders once established. Only three states (Kentucky, Maine, and West Virginia) have been created directly from area belonging to another state (although at the time of admission, Vermont agreed to a monetary payment for New York to relinquish its claim); all of the other states were created from federal territories or from acquisitions. Four states (Louisiana, Missouri, Nevada, and Pennsylvania) have expanded substantially by acquiring additional federal territory after their initial admission to the Union. In 1912, Arizona was the last state established in the contiguous United States, commonly called the "lower 48". In 1959, Hawaii was the 50th and most recent state admitted.