He is best known for "Don Quixote", but the eventful life of Spain's revered author Miguel de Cervantes was just as intriguing as any adventures of the delusional wanna-be knight of his famous novel.
Cervantes -- whose death on April 22, 1616 will be commemorated in Spain this week just as Britain marks the passing of Shakespeare 400 years ago -- survived a sea battle, capture by pirates, five years of captivity in Algiers and stints in prison.
"What gives such power to Cervantes' literature is that he lived his life so intensely," says photographer Jose Manuel Navia, who, for a Madrid exhibition, travelled to sites where the author once set foot.
Many questions surround the life of the soldier turned captive turned tax collector, whose writings largely took a back bench until he achieved overnight success with "Don Quixote" in his late fifties.
Using official archives, scant witness accounts and autobiographical prefaces to his books, academics have for decades tried to decipher the myth of the man known as the father of the modern novel.
Born in 1547 in Alcala de Henares near Madrid, his family struggled financially.
They settled in Madrid when the future superstar author was close to 20, and he wrote his first known poetry there.
But a few years later in 1569, Cervantes moved to Rome for reasons that remain unclear, and may have had to do with his involvement in a duel that forced him to escape.
In Italy, he enlisted as a soldier and fought in the 1571 Battle of Lepanto that saw more than 200 galleys of an alliance of Christian powers confront and defeat an Ottoman Empire fleet in the seas off Greece.
"Trembling with fever, he lies in a rickety old bed infested with lice between decks in an area that serves as a sick bay... afflicted by sea sickness and malaria," writes biographer Jean Canavaggio of the day of the battle.
But Cervantes still went on deck to fight, ending up shot in the chest and in the left hand, which he would never again be able to use.
After recovering from his wounds, Cervantes continued to participate in military campaigns until deciding to return to Spain in 1575.
But his ship was captured by pirates and Cervantes was taken to Algiers -- a bustling city administered by the Ottoman Turks.
He remained there for five years despite several attempts to escape, waiting to be freed in exchange for a ransom.
One of these attempts saw him and others hole up in a cavern east of Algiers for five months, waiting for a ship dispatched by his brother that never arrived.
Eventually, his family and a religious order raised money for the ransom and he returned to Spain, where he tried unsuccessfully to get official postings in return for his services as a soldier.
Then in 1584, Cervantes had a daughter -- his only offspring -- with one woman before marrying another who was nearly 20 years his junior.
He settled with her in a tiny village in the central region of Castilla-la-Mancha, where "Don Quixote" would later be based.
During that time he wrote his first novel "La Galatea," without much success.
Finally in 1587, he got an official posting that saw him on the move again, criss-crossing southern Spain for the next decade requisitioning wheat and oil for authorities and then collecting taxes.
During that time, he went to prison for what may have been debt-related reasons, and some believe he could have started dreaming up "Don Quixote" then.
When the novel was finally published in 1605, it was an overnight success.
The years after saw Cervantes move to Madrid and devote his time to writing -- including the second part of "Don Quixote" -- before dying of illness in 1616, a relatively poor man who probably never expected to leave such a lasting literary legacy.
"Don Quixote" has become one of the world's most translated works, perhaps only surpassed by the Bible.
Its tale of a man who fancies himself as a knight and set outs to rid the world of its ills has been universally praised.
Cervantes' portrayal of a hero as vulnerable and imperfect as any other human being was revolutionary, and inspired authors from Jane Austen and Fyodor Dostoyevsky to Gustave Flaubert and Mark Twain.
More than 300 events -- exhibitions, plays, readings, conferences -- are taking place in Spain over the year to mark his death.
On Saturday, Spain's royals and Prime Minister Mariano Rajoy will go to Alcala de Henares to attend the prize-giving ceremony for the annual Miguel de Cervantes award, which honours the lifetime achievement of a writer.
And for Javier Rodriguez Palacios, mayor of Alcala de Henares, the author is still hugely relevant today.
"You describe his life to a 16-year-old guy... and he will start to realise that what is happening now in some places -- unemployment, youth having to go abroad, occasional conflict between those of Spanish origin and those who aren't -- Cervantes experienced this too," he says.