The War of 1812 was fought in 1812-1815 between the United States and Britain. The U.S. declared war after a series of trade restrictions introduced by Britain to impede neutral trade with France whom Britain was also at war with. The U.S. considered these to be illegal under international as well as the impressment (forced recruitment) of U.S. citizens into the British Royal Navy.
After two years of warfare, during which the major causes disappeared and neither side saw a reason to go on, peace was signaled when the Treaty of Ghent was signed on 24 December 1814. However news of the treaty arrived only after a U.S. victory at the Battle of New Orleans. This final victory produced a sense of euphoria regarding a "second war of independence." Meanwhile, the confederations of Indian tribes allied to the British had been broken.
While the British naval blockade of the U.S. coast was a success, the land warfare was a draw. The U.S. initially tried repeatedly to invade Upper Canada with no success; the British launched multiple invasions that were beaten back. At the end, the British held parts of Maine and some outposts in the west while the Americans held Canadian territory near Detroit, but all occupied territories were restored at the end of the war.
War of 1812 in Trail of Glory