When did the US fight a war with tripoli?
First Barbary War - 1801 to 1805
The question seems to be asking in what war the US Marine Corps first fought. The Continental Marines were formed in 1775 to fight the British in the American Revolution, but the US Marine Corps was founded in 1794, and their first opponents were the Pirates of Tripoli. US Marines participated in later wars in small numbers, but they did not actually attain the size of a corps until World War 2.
In May 1801, the pasha demanded an increase inthe tribute($83,000) which the U.S. government had been paying since 1796 for the protection of their commerce from piracy under the 1796 treaty with Tripoli. The demand was refused, and a naval force was sent from the US to blockade Tripoli. Whoever wrote the first answer is an idiot.