Prior to the War of 1812, Lewis declined the office of US Secretary of War under President James Madison. Instead, he resumed his duties as Quartermaster General and served in western New York. He was commissioned as a brigadier general on April 3, 1812 and was promoted to major general on March 2, 1813 as part of his service on the Niagara Frontier. He commanded the American forces at the Battle of Fort George. Although the British position was captured, Lewis ordered Colonel Winfield Scott to break off the pursuit of the defeated British troops. But for Lewis's overcaution, Scott might have been able to capture Major General John Vincent's entire division and greatly weaken the British defense of the Niagara Peninsula. Later, Lewis was appointed as commander of Upstate New York. He procured the release of the American prisoners in Canada, advanced from his private fortune the money for its accomplishment, and rewarded his own tenants who had served in or sent sons to the war by allowing them free rent for the time they served in the army. After the war, Lewis was discharged from the Army on June 15, 1815.