In 1786, Thomas Jefferson, then a minister to the French government of Louis XVI, had a concern more intimidating than anything else he’d faced before: the threat of pirates off the coast of North Africa, a region known as the Barbary Coast.

These pirates had already taken over two American ships, the Dauphin and the Maria, plundering their goods and taking their crews hostage. Unfortunately, this was a common fate for ships venturing near the area, where the Sahara’s arid coast was divided into four Islamic nation-states. Running west to east were the Barbary nations Morocco, Algiers, Tunis, and Tripoli, which all fell under the ultimate authority of the Ottoman Empire, seated in present-day Turkey.

These nations had preyed upon foreign shipping for centuries, attacking ships international waters both in the Mediterranean and along the northwest coast of Africa and the Iberian Peninsula. Even such naval powers as France and Great Britain were not immune, though they chose to deal with the problem by paying annual tributes of “gifts” to the Barbary leaders—bribes paid to the Barbary states to persuade the pirates to leave merchant ships from the paying countries alone. But the prices were always changing, and the ships of those nations that did not meet the extortionate demands were not safe from greedy pirates.

Unable to pay enough to buy the goodwill of the Barbary countries, America was forced to let its ships sail at their own risk. Jefferson and Adams knew the new nation couldn’t afford a new war or a new source of debt. But they also understood that the cost of keeping American ships away from the Barbary Coast would be greater than the cost of addressing the problem. That left Jefferson and good friend and United States’ ambassador to Great Britain John Adams, as Jefferson said in March of 1786, feeling “absolutely suspended between indignation and impotence.”

But Adams had new reason to hope that the Barbary rulers could be reasoned with. A few weeks earlier, Adams had made an unannounced visit to the Barbary state of Tripoli’s ambassador, freshly arrived in London.

To Adams’s surprise, the bearded Sidi Haji Abdrahaman had welcomed him warmly. Adams decided his new diplomatic acquaintance was “a benevolent and wise man” with whom the United States could do business. He believed Abdrahaman might help broker an arrangement between the United States and the other Barbary nations, bringing an end to the capture of American merchantmen. Now reunited with his friend and fellow American, Adams shared his plan with Jefferson and invited him to join the conversation.

On a blustery March day, Adams, Jefferson, and Abdrahaman convened at the house of the Tripolitan envoy. The conversation began in an improvised mix of broken French and Italian, as the Tripolitan envoy spoke little English. The discussion was cordial, and Adams and Jefferson began to believe that a solution was in sight.

When the talk turned to money, however, the bubble of optimism soon exploded.

Jefferson had researched the sums paid as tribute by European countries, including Denmark, Sweden, and Portugal, so he knew the going rate. But the gold Abdrahaman demanded that day was beyond the reach of the United States: a perpetual peace with Tripoli would cost some 30,000 English guineas, the equivalent of roughly $120,000, not counting the 10 percent gratuity Abdrahaman demanded for himself. And that amount bought peace with only one of the Barbary states. To buy peace in Tunis would cost another 30,000 guineas, to say nothing of what would be required to pay Morocco or even Algiers, the largest and most powerful of the four.

The $80,000 that Congress had been hard-pressed to authorize for an across- the- board understanding was no more than a down payment on what would be needed to meet the Barbary demands.

Although he now despaired of an easy solution, Adams wasn’t ready to stop talking. He could understand financial concerns, and he was already beginning to realize what O’Brien would later say of the pirates: “Money is their God and Mahomet their Prophet.” Yet greed alone couldn’t explain the madness and cruelty of the demands. Unsatisfied, the famously blunt Adams wanted a better answer.

While maintaining the best diplomatic reserve he could muster— whatever their frustration, the American ministers could hardly leap to their feet and walk out of the negotiations— Adams asked how the Barbary states could justify “[making] war upon nations who had done them no injury.”

The response was nothing less than chilling.

According to his holy book, the Qur’an, Abdrahaman explained, “all nations which had not acknowledged the Prophet were sinners, whom it was the right and duty of the faithful to plunder and enslave.”

Christian sailors were, plain and simple, fair game.

Jefferson tried to make sense of what he was hearing. He was familiar with the Muslim holy book. He had purchased a copy of the Qur’an during his days of reading law in Williamsburg twenty years before but found its values so foreign that he shelved the volume with books devoted to the mythology of the Greeks and Romans. This conversation left him even more perplexed. The man who had written that all people were “endowed by their Creator with certain inalienable rights” was horrified at Abdrahaman’s religious justification for greed and cruelty.

Dashing Adams’s high hopes, Abdrahaman refused to play the role of “benevolent and wise man.” Despite the Americans’ horror, he wasn’t apologizing in any way. He showed no remorse or regret. He believed the actions of his fellow Muslims fully justified.

When the meeting ended, the two American ministers, disheartened and outraged, left empty- handed. They had found no solution, no peaceful answer to protecting American shipping or freeing their countrymen enslaved in North Africa. They agreed that the status quo was not workable, but that’s where their agreement ended. Adams believed America should pay for peace, but Jefferson expressed another view. He did not wish to “buy a peace,” as he put it. He preferred “the obtaining of it by war.”

But war was too risky at that point, especially against such a powerful threat, and Jefferson was not yet in a position to push the country toward a military conflict. Years passed and continued attempts at negotiation with the Barbary states proved futile, to the detriment of America’s economy and dignity. But when Thomas Jefferson became president in 1801, he finally got the chance to move beyond diplomacy. He sent the recently re-formed U.S. Navy and Marines to blockade Tripoli, launching the Barbary Wars, which ultimately ended in victory for the United States.

Without this strategic move and the bravery of these heroes, the course of American history would be dramatically different. Our Navy likely wouldn’t be the largest and most capable in the world, and our Marine Corps might not be as integral in protecting our freedom as it is today. America as we know it—a place that is uniquely free and powerful—would not exist.

Reprinted from "THOMAS JEFFERSON AND THE TRIPOLI PIRATES: The Forgotten War That Changed American History" by Brian Kilmeade and Don Yaeger with permission of Sentinel, an imprint of Penguin Publishing Group, a division of Penguin Random House LLC. Copyright (c) Brian Kilmeade and Don Yaeger, 2015, 2016.