Poltifact's judgement is correct from an American point of view, and incorrect from an Islamic point of view. The Barbary pirates were engaged in a particular form of jihad (there is an Arabic phrase which I forget that is usually rendered in English as "jihad on the sea" that describes their activities), and they were loyal subjects of the Caliph (= Ottoman Sultan at that time). To be at war with them, under Sunni Islamic law, was to be at war with the entire Islamic ummah. The Congress of the United States and President Jefferson, of course, regarded themselves as being at war with the Bey of Tripoli and his adherents (the pirates) only, and did not see the matter as a war of religion.