On June 18, 1812, the United States Congress declared that a state of hostilities existed with England, causing great concern and dread among settlers in western New York as able-bodied men were summoned to join the militia and few remained to manage the crops. A British invasion of western New York in midwinter brought great damage and hardship, and after the British burned Buffalo in 1813, the American Army retreated to Batavia, which became a headquarters and final rallying point for remnants of the army and a refuge for homeless frontier residents fleeing the destruction. Joseph Ellicott's home, across the street from this site, was converted into quarters for army officers, his office became a hospital, and private homes, barns, and sheds were occupied as separated families reunited there. Batavia also sheltered General Winfield Scott while he recovered from serious wounds received at Lundy's Lane near Niagara Falls. In 1814, the American Army on the Niagara Frontier succeeded in protecting western New York and won victories before the war ended in December. Batavia was also the site of two arsenals built to strengthen defense west of the Genesee River, both supplied by New York State Governor Daniel D. Tompkins. More broadly, the war, fought between the United States and Great Britain from 1812 to 1814, arose from trade tensions, impressment, British support for Indian raids, and U.S. territorial expansion; in August 1814 the British captured and burned Washington, D.C.; Francis Scott Key wrote "The Star-Spangled Banner" in 1814 after witnessing the bombardment of Fort McHenry; the Treaty of Ghent ended the war in late 1814 after five months of negotiations, though news arrived too late to prevent the Battle of New Orleans; and the conflict ultimately led to independence for both the U.S. and Canada.