1. Martin Luther King’s “Letter from Birmingham Jail”

King’s mugshot following his Birmingham arrest.

In April 1963, Dr. Martin Luther King Jr. was tossed in a Birmingham, Alabama, jail cell on charges of leading a public demonstration without a permit. During a nine-day sentence, King used the margins of newspapers and bits of jailhouse toilet paper to draft a response to a group of Birmingham clergymen that had denounced his fight against segregation and labeled him an “outside agitator.” The eloquent, 7,000-word essay used quotes from St. Thomas Aquinas, Thomas Jefferson and others to examine the nature of unjust laws and civic responsibility, and included the immortal line, “Injustice anywhere is a threat to justice everywhere.” King’s associates smuggled the scattered scraps of paper out of the jail and typed them up a few days before his release. “Letter from Birmingham Jail” soon appeared in publications across the nation and went on to become a touchstone of the American civil rights movement.

2. Marco Polo’s “Travels”

A few years after returning from his 24-year trek through Asia, Marco Polo was captured while leading a Venetian galley into battle against the rival Italian city-state of Genoa. Confined to prison, the 44-year-old merchant passed the time by regaling his fellow inmates with tales of his journeys in China and his years spent in the employ of the Mongol ruler Kublai Khan. Polo’s jailhouse yarns caught the attention of a writer and fellow prisoner named Rustichello of Pisa, and the duo eventually collaborated on the book “Description of the World,” more commonly known as the “Travels.” This epic, often embellished travelogue sealed Polo’s legacy as one of the world’s great explorers and provided many Europeans with their first glimpse into the wonders of the Far East.

3. Nelson Mandela’s Autobiography

Nelson Mandela visits his former prison cell on Robben Island in February 1995.

Before he was South Africa’s first black president, Nelson Mandela was inmate number 466/64 at Robben Island, one of three prisons in which he eventually did 27 years of hard time. In 1974, while confined to an 8-by-7-foot cell, he began secretly writing an autobiography documenting his years as an anti-apartheid activist and revolutionary. Fellow inmates offered criticism and suggestions, and a prisoner named Mac Maharaj painstakingly transcribed Mandela’s manuscript into tiny text to save space. After completing the book, Mandela buried the original copy in the prison garden. Guards eventually discovered it, but by then, Maharaj and others had been freed and smuggled the transcript out with them. The autobiography remained unreleased until 1994 when Mandela used it to help shape his famous book “Long Walk to Freedom.”

4. John Bunyan’s “The Pilgrim’s Progress”

Originally a tinker by trade, England’s John Bunyan first made his name in the late-1650s, when he found religion and became a popular separatist preacher. Along with drawing crowds and followers, Bunyan’s stirring sermons soon drew the ire of the monarchy, which considered it illegal for him to hold religious gatherings that did not conform to the Anglican Church. In 1660, he was arrested and confined to jail in Bedford. Bunyan’s crime only carried a three-month sentence, but since he refused to quit preaching, he eventually spent more than 12 years behind bars. During this time, he used his experiences with state persecution to begin work on “The Pilgrim’s Progress,” a religious allegory that follows the adventures of a Christian crusader who endures trials and tests on his journey to a paradise called “Celestial City.” Bunyan published “The Pilgrim’s Progress” in 1678 after his release from jail, and the book went on to become a runaway success. It has been in constant circulation ever since and is often cited as one of the landmark novels of the 17th century.

5. Adolf Hitler’s “Mein Kampf”

In 1923, Adolf Hitler led members of the upstart Nazi Party in a failed coup known as the “Munich Beer Hall Putsch.” Condemned to Bavaria’s Landsberg Prison on charges of high treason, the young radical spent the next several months writing “Mein Kamp” (“My Struggle”), a mammoth volume that was equal parts memoir, political tract and racist screed. The book was effectively a schematic for the “Third Reich” that Hitler would go on to create as Germany’s ruler. In a rage-fueled and often bombastic style, he describes the need to preserve the purity of Germany’s Aryan race and outlines a plan to strike a blow of revenge against nearby France and Russia. Volume one of “Mein Kampf” was published in 1925, shortly after Hitler had completed his nine-month sentence. The book was initially a flop, but it later sold millions of copies during the Nazi’s rise to power in the 1920s and 30s.

6. Sir Thomas Malory’s “Le Morte d’Arthur”

Illustration of King Arthur and Excalibur.

Little is known about the author of the most famous collection of tales about King Arthur’s Camelot, but evidence indicates that Sir Thomas Malory was not a particularly chivalrous fellow. If historians’ assumptions about his identity are correct, Malory was a Warwickshire knight and all-around rogue who was repeatedly jailed for crimes ranging from extortion and attempted murder to theft and even rape. It was while under lock and key in 1470 that the self-described “Knight-Prisoner” supposedly put the finishing touches on “Le Morte d’Arthur,” the book that would later introduce the world to Excalibur and the Knights of the Round Table.

7. Marquis de Sade’s “120 Days of Sodom”

Along with penning some of history’s most scandalous literature, the French writer Marquis de Sade also spent more than a third of his life in prison for acts of sexual cruelty and violence. During a 1785 stint in the Bastille, Sade secretly wrote “The 120 Days of Sodom,” a stomach-turning story of torture, rape and depravity that he proudly called “the most impure tale that has ever been told since our world began.” Sade scribbled the entire novel on a single 39-foot-long roll of paper and stashed it in a crack in the wall of his cell to prevent it from being confiscated. He lost track of the lone copy after he was transferred to a new prison during the French Revolution, and the book wasn’t rediscovered and published until decades after his death in 1814. The book has since been repeatedly banned and denounced as obscene, but in 2014, a French museum owner paid 7 million Euros to buy Sade’s original handwritten manuscript.

8. Boethius’ “Consolation of Philosophy”

Anicius Manlius Severinus Boethius spent most of his life as one of Italy’s most influential philosophers and statesmen. He reached the peak of his career while heading the government of the Ostrogoth ruler Theodoric in the 520s, but his fortunes later took a severe turn when he was unjustly accused of treason and sentenced to death. As he languished in prison and pondered his imminent demise, Boethius put pen to paper on “Consolation of Philosophy,” an elegant examination of the nature of evil, free will and divine providence. The book consists of a Socratic dialogue between the condemned Boethius and Lady Philosophy, who soothes the prisoner’s outrage and misery by reminding him that a “higher good” controls the universe. Boethius’ death sentence was eventually carried out sometime around 524 A.D., but his “Consolation of Philosophy” went on to become one of the most widely studied texts of the Middle Ages.