In the war that followed, American forces blockaded, raided and defeated the Barbary fleets. Incidentally, they destroyed the Philadelphia so it could no longer be used by their enemies. In a final glorious action, Marines landed, marched 600 miles across the desert, and captured the city of Derna in 1805.
This was the first time the United States flag was raised in victory on foreign soil. Lt. Presley O'Bannon, heroically commanding in the battle, raised the flag himself.
And whaddaya know, the Barbary States decided to sign a peace treaty shortly thereafter. Oorah, Marines!
If you're wondering about the American marine cockades of this era, they continued to be the standard military black rosettes or fans instituted by George Washington. In fact, you can see those black cockades on much of the artwork of the Quasi War and the Barbary Wars.