Muslim pirates and privateers worked in and around North Africa, harassing American trade ships while Adams and Jefferson were diplomats. Jefferson negotiated with them for the release of hostages. While president, Jefferson would engage in the First Barbary War.
The Adams-Jefferson Letters