==Background==After the First Barbary War (1801–1805), the U.S. found its attention diverted to its worsening relationship with Great Britain over trade with France, which culminated in the War of 1812.