In the War of 1812, the United States took on the greatest naval power in the world, Great Britain, in a conflict that would have an immense impact on the young country’s future. Causes of the war included British attempts to restrict U.S. trade, the Royal Navy’s impressment of American seamen and America’s desire to expand its territory. The United States suffered many costly defeats at the hands of British, Canadian and Native American troops over the course of the War of 1812, including the capture and burning of the nation’s capital, Washington, D.C., in August 1814. Nonetheless, American troops were able to repulse British invasions in New York, Baltimore and New Orleans, boosting national confidence and fostering a new spirit of patriotism. The ratification of the Treaty of Ghent on February 17, 1815, ended the war but left many of the most contentious questions unresolved. Nonetheless, many in the United States celebrated the War of 1812 as a “second war of independence,” beginning an era of partisan agreement and national pride.