John Adams narrowly defeated Thomas Jefferson in the 1796 presidential election, becoming president, while Jefferson became vice president. This was problematic because their parties, the Federalists and Democratic-Republicans, opposed each other. Further tensions arose from disagreements over the Jay Treaty with Britain and the XYZ Affair, where France demanded bribes from American envoys. The Federalists passed the controversial Alien and Sedition Acts to suppress opposition.