[61] In pursuit of national unity, newly elected president James Monroe decided a Northerner would be optimal for the position of Secretary of State, and he chose the respected and experienced Adams for the role.[62] Having spent several years in Europe, Adams returned to the United States in August 1817.[61]

Secretary of State (1817–1825)
See also: Presidency of James Monroe
Adams served as Secretary of State during Monroe's eight-year presidency, from 1817 to 1825. Many of his successes as secretary, such as the convention of 1818 with the United Kingdom, the Transcontinental Treaty with Spain, and the Monroe Doctrine, were not preplanned strategies but responses to unexpected events. Adams wanted to delay American recognition of the newly independent republics of Latin America to avoid the risk of war with Spain and its European allies. However, Andrew Jackson's military campaign in Florida and Henry Clay's threats in Congress forced Spain to cut a deal, which Adams negotiated successfully. Biographer James Lewis says, "He managed to play the cards that he had been dealt – cards that he very clearly had not wanted – in ways that forced the Spanish cabinet to recognize the weakness of its own hand".