A few years later, in 1786, the new United States found that it was having to deal very directly with the tenets of the Muslim religion. The Barbary states of North Africa (or, if you prefer, the North African provinces of the Ottoman Empire, plus Morocco) were using the ports of today's Algeria, Libya, and Tunisia to wage a war of piracy and enslavement against all shipping that passed through the Strait of Gibraltar. Thousands of vessels were taken, and more than a million Europeans and Americans sold into slavery.
The fledgling United States of America was in an especially difficult position, having forfeited the protection of the British Royal Navy. Under this pressure, Congress gave assent to the Treaty of Tripoli, negotiated by Jefferson's friend Joel Barlow, which stated roundly that "the government of the United States of America is not, in any sense, founded on the Christian religion, as it has in itself no character of enmity against the laws, religion or tranquility of Musselmen." This has often been taken as a secular affirmation, which it probably was, but the difficulty for secularists is that it also attempted to buy off the Muslim pirates by the payment of tribute.
That this might not be so easy was discovered by Jefferson and John Adams when they went to call on Tripoli's envoy to London, Ambassador Sidi Haji Abdrahaman. They asked him by what right he extorted money and took slaves in this way. As Jefferson later reported to Secretary of State John Jay, and to the Congress:
The ambassador answered us that [the right] was founded on the Laws of the Prophet, that it was written in their Koran, that all nations who should not have answered their authority were sinners, that it was their right and duty to make war upon them wherever they could be found, and to make slaves of all they could take as prisoners, and that every Mussulman who should be slain in battle was sure to go to Paradise.
I believe on the evidence that it was at this moment that Jefferson decided to make war on the Muslim states of North Africa as soon as the opportunity presented itself. And, even if I am wrong, we can be sure that the dispatch of the U.S. Navy and Marine Corps to the Barbary shore was the first and most important act of his presidency.
It took several years of bombardment before the practice of kidnap and piracy and slavery was put down, but put down it was, Quranic justification or not.