The correct answer is John Quincy Adams, who was elected as president in the election of 1824. This election is notable as it is considered one of the most contentious in American history, resulting in a four-way race among prominent political figures including Adams, Andrew Jackson, William H. Crawford, and Henry Clay.
John Quincy Adams aligned with the National Republicans, a faction that would later evolve into the Republican Party in the 1850s. At the time of the election, the Democratic-Republican Party was the dominant political force, but it was beginning to fracture into different factions, including those that would develop into the modern Democratic Party and the National Republicans. Although Andrew Jackson won the popular vote, John Quincy Adams became president after a contingent election in the House of Representatives, following the failure to secure a majority in the Electoral College.
This election marked a significant turning point in American political history, as it reflected the increasing competition and shifting alliances that characterized the period. Thus, the election of 1824 is often seen as a crucial precursor to the formation of a more organized two-party system in the United States.