Adams stood almost alone in arguing that everything should be done to prevent the fledgling America from war with France, which was a powerful country despite its internal chaos. He found that some of the greatest pressure came from the head of his own party, Alexander Hamilton. On the other hand, Adams' vice president and head of the opposition, Thomas Jefferson, urged the country to ignore Jay's Treaty, side with France against England in the ongoing dispute between the European powers. Adams called a special session of Congress to deal with situation and in his message to the congressional body he urged for peace. He proposed that the Army and Navy should stay put while a new group of three peace negotiators left for France to try and wrangle a solution. What ensued brought about the defining crisis of Adams' administration.
The French government refused to meet with the new peace ambassadors. However, they were approached by agents working for the French Foreign Minister, Charles Talleyrand, who offered a different sort of deal: The alleged slights to France could be corrected with a lump payment to Talleyrand and a generous loan to the suffering French government. The Americans balked at paying what amounted to a bribe to the government and refused the offer–they quickly sent a report to Adams back in Philadelphia. He declared on March 19 that he could not perceive "[any] ground of expectation that the objects of their mission can be accomplished on terms compatible with the safety, honors or the essential interests of the nation." Adams, appalled at the gall of the French but realizing the consequences if the report was published, tried to keep it under wraps while he asked for defensive measures. Jefferson and his fellow pro-French Republicans, not knowing the results of the peace mission, charged that Adams was quashing information sympathetic to the French in the hopes of starting a war. Under extreme pressure, Adams allowed the report to be published, but only after changing the names of the French agents to X, Y, and Z–hence the event came to be known as the XYZ Affair.
Jefferson's effort to publish the report backfired quickly as Americans expressed outrage over the insulting XYZ Affair. Jefferson found himself now on the defensive, pleading for help, as America shouted for war with the French: He explained that there was no proof that the agents in question actually worked for, or at least came under orders from, Talleyrand. Hamilton, the head of the anti-French forces from the beginning, and incited by the admission of the XYZ Affair, convinced his fellow Federalists to renounce America's treaties with France. War was at hand. America launched a dozen naval ships by the end of 1798 and, despite his reluctance, Adams pushed ahead for military mobilization. Strangely, amid the patriotic fervor of the coming war, Adams achieved his greatest popularity, becoming the subject of laudatory editorials across the nation.
As part of the war footing, Congress passed and Adams signed what came to be known as the Alien and Sedition Acts–perhaps the most ill-conceived and illogical laws (not to mention unconstitutional laws) ever enforced. The laws seriously arrested the expression of free speech, especially political dissent and discussion, within the United States. The Acts were composed of four laws, supposedly dealing with the protection of national security, the Alien Enemies Act, the Alien Friends Act, the Naturalization Act, and the Sedition Act. The Alien Enemies Act defined how the government could determine whether foreigners posed a threat in wartime–this Act was not used in 1812. The second, the Alien Friends Act, allowed the president to deport any foreigner–in peacetime and in war–whom he deemed a threat to the country. The third, the Naturalization Act, lengthened the time it took become a citizen of the US from five to fourteen years. The fourth and final act, also the most controversial and unconstitutional, the Sedition Act, forbade any individual to oppose "any measure or measures of the United States," or to speak, write or print anything about the president that caused him "contempt or disrepute." The Sedition Act expired in 1801, but not before four of the five major Republican newspapers had been charged with sedition and several foreign- born writers threatened with expulsion. Of the seventeen people charged under the Act, ten were convicted. The acts were meant to help solidify the Federalists hold on power in the 1798 and 1800 elections. Although Adams never vigorously enforced these laws, they quickly became synonymous with the Federalist Party and Adams in particular. Far from helping the Federalists, however, the Alien and Sedition Acts turned much of the country against them.
Back on the international affairs front, Adams was quietly cooling the tempers that called for war with France–and, in doing so, caused a split with Hamilton. Adams was losing faith in his Cabinet and, without discussing the idea with anyone except his son, Adams announced a new peace mission to France on February 18, 1799. The mission would be led by William Vans Murray, who would have full diplomatic powers to sign a treaty. The cabinet tried to block the move, but Adams sent it on the mission on without further delay. Although the negotiations lasted for months, they proved fruitful. War was prevented. The friendship of Adams and Hamilton, however, was over. Then, in danger of losing control of his Hamilton-controlled cabinet, Adams forced his secretary of state and secretary of war out of office. Although he had successfully cleaned his administration, the split with Hamilton would contribute to Adams' loss in the upcoming election.