John Quincy Adams was, in 1828 the first president to be elected by the House of Representatives. He represented the wing of his party, which in 1831 was reorganized into the National Republican Party and would shortly be supplanted by the Whig Party. His election was controversial, because he had named Henry Clay Secretary of State in what Andrew Jackson, the winner of the popular vote alleged was a corrupt bargain.
Tariff of Abominations
One of the first bills passed establishes the tariffs that Congress wanted but were vetoed under Madison. Immediately there is talk in the South of nullification. In 1831 South Carolina nullifies the tariff. Vice President Calhoun resigns as vice president and supports South Carolina.
Worcester v Georgia
A Supreme Court decision rules that Georgia can't apply its laws to Cherokee territory. John Quincy Adams, an opponent of Indian removal enforced the decision.
Andrew Jackson, while opposing nullification ran against Adams on a platform of reducing tariffs, and Indian Removal as well as stressing the "corrupt bargain". Jackson easily won.