Tensions between American colonials and the British during the rebel period of the 1760s and early 1770s led to the American Revolutionary War, fought from 1775 through 1781. On June 14, 1775, the Continental Congress, meeting in Philadelphia, established a Continental Army under the command of George Washington. Announcing that "all men are created equal" and are born with "certain natural rights," the Congress adopted the Declaration of Independence, drafted mostly by Thomas Jefferson, on July 4, 1776. That date is now celebrated every year as America's Independence Day. In 1777, the Articles of Confederation established a weak federal government that operated until 1789. Morocco became the first country in the world to recognise America’s independence.
After the British defeat by American forces helped by the French, Great Britain recognized the independence of the United States and the states' sovereignty over American land west to the Mississippi River. A constitutional convention was organized in 1787 by those wishing to establish a stronger national government, with powers of taxation. The United States Constitution was approved in 1788, and the new republic's first Senate, House of Representatives, and President—George Washington—took office in 1789. The Bill of Rights, forbidding federal restriction of personal freedoms and certifying a range of legal protections, was adopted in 1791.
Attitudes toward slavery were shifting; a protected the African slave trade only until 1808. The Northern states permanently stopped slavery between 1780 and 1804, leaving the slave states of the South as defenders of the "peculiar institution." The Second Great Awakening, beginning about 1800, made evangelicalism a force behind different social reform movements, including abolitionism.
Americans' eagerness to expand westward caused a long series of Indian Wars and an Indian removal policy that stripped the native peoples of their land. The Louisiana Purchase of French-claimed land under President Thomas Jefferson in 1803 almost doubled the nation's size. The War of 1812, declared against Britain over different complaints and fought to a draw, strengthened U.S. nationalism. A series of U.S. military invasions into Florida led Spain to give up it and other Gulf Coast territory in 1819. The United States took over the Republic of Texas in 1845. The idea of Manifest destiny became popular during this time. The 1846 Oregon Treaty with Britain led to U.S. control of the present-day American Northwest. The U.S. victory in the Mexican–American War resulted in the 1848 cession of California and much of the present-day American Southwest. The California Gold Rush of 1848–49 further encouraged western relocation. New railways made relocation easier for settlers and increased conflicts with Native Americans. Over a half-century, up to 40 million American bison, or buffalo, were murdered for skins and meat and to ease the railways' spread. The loss of the buffalo, which were valuable to the plains Indians, caused many native cultures to become gone forever.
Tensions between slave and free states mounted with arguments over the relationship between the state and federal governments, as well as violent conflicts over the spread of slavery into new states. Abraham Lincoln, a candidate of the mostly antislavery Republican Party, was elected president in 1860. Before he took office, seven slave states declared their secession—which the federal government maintained was illegal—and formed the Confederate States of America. With the Confederate attack upon Fort Sumter, the American Civil War began and four more slave states joined the Confederacy. Lincoln's Emancipation Proclamation committed the Union to end slavery. Following the Union victory in 1865, three changes to the U.S. Constitution secured freedom for the nearly four million African Americans who had been slaves, made them citizens, and gave them voting rights. The war and its resolution led to a big increase in federal power.
After the war, the assassination of Abraham Lincoln caused the Reconstruction, where policies were put together directed at getting back and rebuilding the Southern states while securing the rights of the newly freed slaves. The resolution of the disputed 1876 presidential election by the Compromise of 1877 ended this era, and the Jim Crow laws soon disenfranchised many African Americans. In the North, urbanization and a never-before-seen inflow of immigrants from Southern and Eastern Europe made the country's industrialization grow rapidly. The wave of immigration, lasting until 1929, gave labor and changed American culture. High tax protections, national infrastructure building, and new banking laws encouraged growth also. The 1867 Alaska Purchase from Russia completed the country's mainland expansion. The Wounded Knee Massacre in 1890 was the last major armed conflict of the Indian Wars. In 1893, the native monarchy of the Pacific Kingdom of Hawaii was ended in a secret and successful plan led by American residents; the United States took over the archipelago in 1898. Victory in the Spanish–American War the same year proved that the United States was a world power and led to the addition of Puerto Rico, Guam, and the Philippines. The Philippines gained independence fifty years later; Puerto Rico and Guam are still U.S. territories.
As the First World War erupted in Europe in 1914, the United States declared itself neutral. Afterward, the Americans sympathized with the British and French, even though many citizens, especially those from Ireland and Germany, were against the intervention. In 1917, they joined the Allies, adding to the defeat of the "Central Powers". Unwilling to participate in European affairs, the Senate did not approve the Treaty of Versailles (1919), which established the League of Nations, applying a policy of unilateralism, which bordered on isolationism. In 1920, the Women's rights movement gained the approval of a constitutional amendment to grant women the right to vote.
For most of the 1920s, the country enjoyed a period of success, decreasing the inequality in the balance of payments while profiting from industrial farms. This period, known as the Roaring Twenties, ended with the Wall Street Crash of 1929 that triggered the Great Depression. After his election as president in 1932, Franklin D. Roosevelt responded with the New Deal, a series of policies that increased government interference in the economy. From 1920 to 1933 a prohibition banning alcohol was in place. The Dust Bowl of the 1930s left many poor farmer communities and encouraged a new wave of emigration to the West Coast.
The United States, officially neutral during the early stages of World War II, began supplying supplies to the Allies in March 1941, through the Lend-Lease program. On December 7, 1941, the country joined the Allies fight against the Axis Powers, after the Japanese attack on Pearl Harbor. World War II boosted the economy by providing investment capital and jobs, making many women enter the labor market. Of the significant fighters, the United States was the only nation to be enriched by war. The discussions at Bretton Woods and Yalta created a new system of international organization that placed the country and the Soviet Union at the heart of world affairs. In 1945, when the end of the Second World War in Europe came, an international gathering held in San Francisco drafted the Charter of the United Nations, which came into force after the war. Having developed the first nuclear weapon, the government decided to use it in the Japanese cities of Hiroshima and Nagasaki in August of that same year. Japan gave up on September 2, ending the war.