During the War of 1812, Watterston participated in the unsuccessful defense of the national capitol. The British burned the city, including the Library of Congress, which was then housed in the Capitol building. After war's end, President James Madison appointed Watterston as Librarian of Congress, the third person to hold the position and the first with that as his sole responsibility. (Previous librarians also served as the clerk of the House of Representatives). Congress replenished the library by purchasing the collection of former President Thomas Jefferson. Watterston gave the collection's books bookplates and labels and kept them organized according to Jefferson's basic classification scheme. He also continued writing, including the comic novel "The L— Family at Washington; or, A Winter in the Metropolis" (1922), "A Course of Study preparatory to the Bar or Senate" (1827) and "The Wanderer in Washington" (1827).