The 1807 Treaty with Tripoli ended the First Barbary War, allowing American ships to sail freely in the Mediterranean without tribute payments. This victory spurred national pride, with many Americans viewing the war as a continuation of their revolutionary ideals. However, new challenges emerged in the Atlantic as the Napoleonic Wars intensified, pressuring U.S. trade. Jefferson's attempt to protect American neutrality through an embargo on Britain and France faced domestic resistance and ultimately proved ineffective. Tensions boiled over with the Chesapeake-Leopard Affair, where a British warship attacked the U.S. Chesapeake, pushing the nations closer to conflict.
In the Mediterranean, American withdrawals left U.S. ships vulnerable, leading to renewed pirate attacks that forced the U.S. to resume tribute payments. Jefferson's preference for a small, defensive fleet backfired, and America soon found itself unable to protect its Mediterranean interests. By 1812, escalating disputes with Britain led the U.S. to declare war, hoping British preoccupation with France would offer an advantage. American victories, particularly the USS Constitution's successes and the Battle of New Orleans, bolstered U.S. morale. The Treaty of Ghent ended the War of 1812 without territorial gains, but American resilience was solidified, and the British eventually ceased impressing American sailors.