John Adams' presidency from 1797 to 1801 was unproductive and frustrating. The XYZ Affair strained relations with France and led to the Quasi-War, a naval conflict between the two countries. Additionally, the Federalist-controlled government passed the controversial Alien and Sedition Acts to restrict immigrants and opposition newspapers. This prompted the Kentucky and Virginia Resolutions arguing states could nullify federal laws, setting a precedent for states' rights. There were also slave and tax-based rebellions. The 1800 election between Jefferson and Adams ended with Jefferson winning after support from Hamilton. Adams also made last-minute judicial appointments before leaving office.