(CNN) He was 37 when the army of "wicked men" invaded his West African village, murdering many and absconding with others who they put on a ship for the six-week journey to Charleston, South Carolina.

"There, they sold me to a small, weak and wicked man called Johnson, a complete infidel who had no fear of God at all," scholar and slave Omar ibn Said wrote decades later in 1831, when he was in his early 60s.

His disheartening story, told a quarter-century after his arrival in Charleston, is now online after the Library of Congress acquired and published the essay, the only known surviving autobiography of a Muslim-American slave.

Written in Arabic and translated later to English, the essay is part of a 42-document collection that moved among owners over the years and even disappeared for a spell. In 1996, the autobiography was sold at auction for $20,000, according to Davidson College

"To have it preserved at the Library of Congress and made available to everyday people and researchers across the world will make this collection an irreplaceable tool for research on Africa in the 18th and 19th centuries and will shed light on the history of American slavery," Librarian of Congress Carla Hayden said in a statement.

That it was written in Arabic is important, said Mary-Jane Deeb, chief of the library's African and Middle Eastern division.

"The significance of this lies in the fact that such a biography was not edited by Said's owner, as those of other slaves written in English were, and is therefore more candid and more authentic," she said.

'Wicked men took me by violence'

Ibn Said was born to a wealthy family in what is today the West African nation of Senegal. He spent a quarter century studying and was considered a prolific scholar. In 1807, however, the wicked men came to the Futa Tooro region he called home.

"Then there came to our places a large army, who killed many men and took me and brought me to the great sea and sold me into the hands of the Christians, who bound me and sent me on board a great ship and we sailed upon the great sea a month and a half when we came to a place called Charleston in the Christian language," he wrote.

"I reside in this our country by reason of great necessity. Wicked men took me by violence and sold me to the Christians."

Omar ibn Said, circa 1850.

In Charleston, he met another wicked man -- his slave master, Johnson, "who feared not God at all, nor did he read (the gospel) at all nor pray. I was afraid to remain with a man so depraved and who committed so many crimes and I ran away."

Too feeble, by his own admission, for hard labor, ibn Said escaped Johnson and fled, eventually making his way about 200 miles north to just outside Fayetteville, North Carolina, which he transliterates as "Fayd-il" in the essay.

He went into a church to pray and was spotted by a "lad," who reported him to his father. Two men on horseback with a "troop of dogs" arrived and took him to jail, which ibn Said describes as "a great house from which I could not go out."

Sold to North Carolina royalty

Sixteen days later, several men came to the jail. He did not understand their questions. He left with a man named Bob Mumford, he wrote, whose son-in-law, Jim Owen, asked him if he wanted to go to Owen's home in Bladen County, a plantation on the Cape Fear River.

"I said, Yes, I was willing. I went with them and remained in the place of Jim Owen until now," ibn Said wrote.

Owen was the brother of the would-be North Carolina governor, John Owen, and after suffering at the whims of his cruel master in Charleston, ibn Said found himself taken with the Owen family. He writes effusively about them throughout the memoir.

"What food they eat they give to me to eat. As they clothe themselves they clothe me. They permit me to read the gospel of God, our lord and saviour and king," he wrote.

When a man named Mitchell tried to buy ibn Said and take him back to Charleston, "I said, 'no, no, no, no, no, no, no, no' I not willing to go to Charleston. I stay in the hand of Jim Owen."

Toward the end of the essay, he wrote, "I continue in the hand of Jim Owen who never beats me, nor scolds me. I neither go hungry nor naked and I have no hard work to do. I am not able to do hard work for I am a small man and feeble. During the last twenty years I have known no want in the hand of Jim Owen. "

A convert to Christianity?

Historical texts indicate ibn Said converted to Christianity in 1820, though some scholars have questioned if his conversion was authentic given that embracing Christianity would have been a prerequisite to a slave's freedom.

Though ibn Said refers to Jesus as the messiah in his essay, scholars point out that the Quran refers to Jesus as such on numerous occasions.

"Formerly, I, Omar, loved to read the book of the Koran the famous," he wrote. "Gen. Jim Owen and his wife used to read the gospel and they read it to me very much -- the gospel of God, our Lord, our Creator, our King."

Earlier in the essay, he says that before arriving in the United States, his was "the religion of Mohammed, the apostle of God." He details washing up before praying at the mosque, fighting in holy wars, pilgrimages to Mecca and paying alms and tithes of gold, silver, seeds, cattle, sheep, goats, rice, wheat and barley.

The Owen family, with the help of Francis Scott Key of "The Star-Spangled Banner" fame, procured an Arabic translation of the Bible for ibn Said. Previously, the family gave him a translated Quran to help him learn English.

Ibn Said died in 1864. He was believed to be in his 90s. He is buried at the Owen family cemetery in Bladen County, North Carolina, though the tombstone is now gone.