After the XYZ Affair, many Americans were furious with France. French officials had demanded bribes before negotiations could begin, and the United States had refused. The incident made many Americans believe France had insulted the United States and threatened its independence.
Tensions soon turned into an undeclared naval conflict known as the Quasi-War. The United States and France never formally declared war, but their ships fought at sea, especially in the Caribbean. Adams strengthened the navy and supported defensive measures, but he still hoped to avoid a full war.

At home, fears about France continued to grow. Many Federalists believed the government needed stronger powers to protect national security. In 1798, Congress passed four laws that became known together as the Alien and Sedition Acts:
The Naturalization Act increased the time immigrants had to live in the United States before becoming citizens.
The Alien Friends Act allowed the president to deport non-citizens considered dangerous.
The Alien Enemies Act allowed the government to detain or deport people from enemy nations during wartime.
The Sedition Act made it a crime to publish certain false or harmful statements against the federal government.
Supporters argued that these laws were necessary during a dangerous conflict. They thought the United States needed to guard against foreign threats and anyone who could weaken the government in a crisis.

Critics saw the laws very differently. They argued that the Alien and Sedition Acts gave the federal government too much power. The Sedition Act was especially controversial because it punished some criticism of the government. Opponents believed this threatened the freedoms of speech and the press.
Adams continued to seek peace with France. In 1800, the United States and France signed the Convention of 1800, which ended the conflict. But news of the agreement arrived too late to help Adams politically. That same year, Adams lost the election of 1800 to Thomas Jefferson.
Adams’s presidency showed how difficult it could be for a young nation to respond to foreign threats. His administration tried to defend national security, but some of its actions raised serious questions about government power and individual freedom.