Two hundred and three years ago this month, President James Madison approved the act of Congress purchasing Thomas Jefferson’s private library. Intended to restock the Library of Congress after its previous holdings were destroyed by British arson during the War of 1812, the transfer of books from Monticello to Washington also highlights a forgotten aspect of religious diversity in early America.

Among the 6,487 books that soon traveled north, Jefferson’s 1734 edition of the Qur’an is perhaps the most surprising.

Historians have attributed the third president’s ownership of the Muslim holy book to his curiosity about a variety of religious perspectives. It’s appropriate to view it that way. Jefferson bought this book while he was a young man studying law, and he may have read it in part to better understand Islam’s influence on some of the world’s legal systems.

But that obscures a crucial fact: To many living in Jefferson’s young nation, this book meant much more. Some scholars estimate 20 percent of the enslaved men and women brought to the Americas were Muslims. While today these American followers of the Prophet Muhammad have been largely forgotten, the presence of Islam in the United States was not unknown among the nation’s citizens in the 18th and 19th centuries. Often practiced in secret, reluctantly abandoned, or blended with other traditions, these first attempts ultimately did not survive slavery. But the mere existence of Islam in the early republic is evidence that religious diversity in this country has a deeper and more complex history than many now know.

Not long before Jefferson's Qur'an rolled north with the rest of his library in 1815, another American attempted to write his own Islamic sacred text, albeit in a form that could not be so easily transported or understood. He wrote his in Arabic on a jail cell wall.

Slave traders captured Omar ibn Said in what is now Senegal and brought him to Charleston, South Carolina, in 1807. He was sold to a man that Said would describe as cruel and a kafir, or infidel. A devout Muslim when he arrived in the United States, Said strived during his enslavement first to maintain his faith, and then to transform it. His story has earned a place in history—as well as in the “Religion in Early America” exhibition, currently on view at the National Museum of American History, and on the Smithsonian Institution’s latest Sidedoor podcast.

Following an attempt to escape from slavery in 1810, Omar ibn Said was arrested in Fayetteville, North Carolina.

While locked in his jail cell, Said became a figure of curiosity, first for his quiet and some said mysterious demeanor, then for the strange way in which he prayed, and finally for the graffiti he began to inscribe on the walls of his cell—Arabic script, most likely verses from the Quran. “The walls of his cell,” it was later reported, “were covered in strange characters, traced in charcoal or chalk, which no scholar in Fayetteville could decipher.”

Omar ibn Said soon became the property of a prominent local political family, which encouraged him to convert to Christianity and persuaded him to write an account of his life.

Through the decades that followed, this family publicized his conversion, placing articles about him in newspapers and broadsides around the United States.

In 1825, a Philadelphia paper recounted the story of his jail time, and how he had been brought to his new faith. In 1837 an article in the Boston Reporter hailed him as a “Convert from Mohammedanism” and devoted two columns to his Christian virtues. In 1854, a reporter wrote that he had “thrown aside the blood­ stained Koran and now worships at the feet of the Prince of Peace.” Though they still held Said in slavery, his owners claimed (without apparent irony) that he wore “no bonds but those of gratitude and affection.”

Yet Omar ibn Said had his own story to tell. Like his jail cell graffiti, his account of his experiences was written in Arabic. Those taking credit for his conversion were unable to read of his true convictions. If they had, they would have seen his adoption of Christianity, while apparently sincere, was also a practical measure.

Before all the things he valued in life had been taken from him, Said said, he had prayed as a Muslim, but now he would say the Lord’s Prayer, he revealed in his writings. But he also peppered his text with prophetic declarations of divine wrath directed at the country that deprived him of his freedom.

O people of America, O people of North Carolina,” he wrote. “Do you have a good generation that fears Allah? Are you confident that He who is in heaven will not cause the earth to cave in beneath you, so that it will shake to pieces and overwhelm you?

Even after his conversion to Christianity, Islam continued to shape his response to enslavement. And in this he was not alone: Plantation owners often made it a point to add Muslims to their labor force, relying on their experience with the cultivation of indigo and rice. Muslim names and religious titles appear in slave inventories and death records.

All of this was common knowledge at the time. Every so often in the 18th and 19th century press, other enslaved Muslims became celebrities of a sort—most often because they were discovered to have levels of erudition well beyond those who claimed to own them.

The earliest example of this was Job ben Solomon, who was enslaved in Maryland in the 1730s. Like Omar ibn Said, after an escape attempt he was jailed and a local judge became so taken with him he wrote a book about their encounter. As the judge wrote, “He shewed upon all Occasions a singular Veneration for the Name of God, and never pronounced the Word Allah without a peculiar Accent, and a remarkable Pause: And indeed his Notions of God, Providence, and a future State, were in the main very just and reasonable.”

The most famous of the enslaved Muslims who found their way into the early American press was a man named Abdul-Rahman Ibrahim.

Known as the Moorish prince he came from an important family in his homeland of Timbuktu, in today’s Mali. His plight drew wide attention in the 1820s, with newspaper stories written around the country. Decades after his enslavement, several well-placed supporters, including secretary of state Henry Clay, and through him President John Quincy Adams, helped to win his freedom and his relocation to Liberia. Before his departure, he offered a critique of religion in a country that had enslaved him for 40 years. As one newspaper account noted, he had read the Bible and admired its precepts but added, “His principal objections are that Christians do not follow them.”

Even counting their population conservatively, the number of enslaved men and women with a connection to Islam when they arrived in colonial America and the young United States was likely in the tens of thousands. Proof that some of them struggled to preserve remnants of their traditions can be seen in the words of those most intent in seeing them fail in this endeavor.

In 1842, Charles Colcock Jones, author of The Religious Instruction of the Negroes in the United States complained that “Mohammedan Africans” had found ways to “accommodate” Islam to the new beliefs imposed upon them. “God, say they, is Allah, and Jesus Christ is Mohammed. The religion is the same, but different countries have different names.”

We can see the same kind of religious syncretism in the writings left behind by Omar ibn Said. In addition to his autobiographical account, he composed an Arabic translation of the 23rd Psalm, to which he appended the first words of the Qur’an: "In the name of God, the Most Gracious, the Most Merciful."

Missionaries like Jones considered such blendings of sacred texts evidence that enslaved Muslims like Said did not have much fidelity to their own religious traditions. But in fact, it proves the opposite. They understood that faith was important enough that they should look for it everywhere. Even in a nation where only non-Muslims like Thomas Jefferson were able to own a Qur'an.

If there were any Muslims at Monticello when his library began its journey to Washington, in theory Jefferson would not have objected to their faith. As he wrote in surviving fragments of his autobiography, he intended his “Virginia Statute of Religious Freedom” to protect “the Jew and the Gentile, the Christian and Mahometan, the Hindoo, and infidel of every denomination.”

Yet such religious differences for Jefferson were largely hypothetical. For all this theoretical support for religious freedom, he never mentioned the fact that actual followers of Islam already lived in the nation he helped to create. Nor did he ever express curiosity if any of the more than 600 enslaved people he owned during his lifetime could have understood his Qur’an better than he did.