The War of 1812, between the United States of America and the British Empire (particularly Great Britain and British North America), was fought from 1812 to 1815.
There were several immediate stated causes for the U.S. declaration of war: first, a series of trade restrictions introduced by Britain to impede American trade with France, a country with which Britain was at war (the U.S. contested these restrictions as illegal under international law); second, the impressment (forced recruitment) of U.S. citizens into the Royal Navy; third, the British military support for American Indians who were offering armed resistance to the expansion of the American frontier to the Northwest. An unstated but powerful motivation for the Americans was the need to uphold national honor in the face of what they considered to be British insults (such as the Chesapeake affair).
The war was fought in four theatres: on the oceans, where the warships and privateers of both sides preyed on each other's merchant shipping; along the Atlantic coast of the U.S., which was blockaded with increasing severity by the British, who also mounted large-scale raids in the later stages of the war; on the long frontier, running along the Great Lakes and Saint Lawrence River, which separated the U.S. from Upper and Lower Canada (Ontario and Quebec); and finally along the coast of the Gulf of Mexico, where U.S. General Andrew Jackson defeated the Creek Indians at the Battle of Horseshoe Bend (1814) and a major British regular army at the Battle of New Orleans (early 1815).
During the course of the war, both the Americans and British launched invasions of each other's territory, all of which were unsuccessful or gained only temporary success. At the end of the war, the British held parts of Maine and some outposts in the sparsely populated West while the Americans held Canadian territory near Detroit, but these occupied territories were restored at the end of the war.