President Jefferson and James Madison fought pirate wars in the 1800s against the Barbary Pirates in the Mediterranean Sea.