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.