Adams was elected to two terms as vice president under President George Washington and was elected as the United States' second president in 1796. He was the only president elected under the banner of the Federalist Party. During his single term, Adams encountered fierce criticism from the Jeffersonian Republicans and from some in his own Federalist Party, led by his rival Alexander Hamilton. Adams signed the controversial Alien and Sedition Acts, and built up the Army and Navy in the undeclared naval war (called the "Quasi-War") with France. During his term, he became the first president to reside in the executive mansion now known as the White House.
In his bid in 1800 for reelection to the presidency, opposition from Federalists and accusations of despotism from Jeffersonians led to Adams losing to his vice president and former friend Jefferson, and he retired to Massachusetts. He eventually resumed his friendship with Jefferson by initiating a correspondence that lasted fourteen years. He and his wife generated the Adams political family, a line of politicians, diplomats, and historians. It includes their son John Quincy Adams, the sixth president. 