"Thou hast conquered, o Galilean." So said Julian the Apostate, Roman Emperor from 361 to 363 AD, invoking Jesus as he lay dying after being shot in battle against the Persians. Except, of course, he didn't say anything of the sort. He died, by all factual historical accounts, with the utmost calm, and never once recanted on the opinions he had expressed in his Refutation of the Christian Religion, a work now sadly lost. But that false confession persists in remaining his most celebrated contribution to posterity.

Emperor Julian was one of the first victims of the deathbed recantation myth. Religionists tend to be adamant that, since there can be no atheists in foxholes, there shouldn't be any in funeral homes, either. They positively palpitate at dramatic accounts of unbelievers crying out for sacraments, or trembling with terror as the demons drag them into the inferno. Consequently, hundreds of rationalists, atheists, humanists and even believers who questioned the orthodoxy of their times have been slandered in their graves.

Such was the frequency and viciousness of these slanders in the nineteenth century that two great secularists, Robert Ingersoll and GW Foote, both felt compelled to write lengthy works refuting the claims. Ingersoll, in his work of 1881, The Great Infidels, wrote of the seven most frequently referenced alleged recanters; Julian, Giordano Bruno, Voltaire, Diderot, David Hume, Benedict Spinoza, and Thomas Paine. Foote, in his work Infidel Death Beds, compiled a much more lengthy alphabetical list, from Lord Amberley, father of Bertrand Russell, to Thomas Woolston, whose Discourses on Miracles was proclaimed to be "the most blasphemous book ever written" by the Attorney General of the time.

And the clergy don't always feel the need to wait until the atheist has actually died. The annals are littered with examples of freethinkers being harassed in their final moments by curates eager to gather souls, and feathers in their caps.

Take Voltaire, for example, a Deist with a refreshing irreverence for the church. Shortly after a run–in with the local clergy in Ferney in 1768, orders were given by the local bishop that Voltaire should not be given communion, confessed or absolved. Voltaire insisted he would commune in defiance of the edict. Feigning illness, Voltaire took to his bed. Though doctors could find nothing wrong with him, he convinced them he was at death's door. A reluctant priest came to his bedside, after Voltaire threatened legal action against him if he did not come. Voltaire demanded absolution at once, but the priest presented him with a profession of faith, drawn up by the bishop, which Voltaire was required to sign. After long argument, the author had his way, was given communion and announced that "having God in his mouth", he forgave his enemies.

As soon as the priest left, Voltaire leapt from his bed, and announced to his friend Wagniere: "I have had a little trouble with this comical genius of a Capuchin; but that was only for amusement, and to accomplish a good purpose. Let us take a turn in the garden. I told you I would be confessed and commune in my bed!"

Voltaire's eagerness to outwit the Church, rather than merely abandon it completely, seems to have stemmed from his wish for a decent burial, rather than be "flung into a ditch or buried like a dog". He did manage to get a proper funeral in the end, but only through the intervention of his priest nephew, rather than any recantation.

Despite his dogged refusal to be bullied by the Church, stories soon spread that on his deathbed, Voltaire was heard to exclaim "I am abandoned by God and man!" and "I shall go to Hell." This, despite the fact that one of the doctors attending him testified that he had been unable to speak at all due to profuse spitting of blood. He did, however, communicate in writing to those present, and never once mentioned God, religion, or the hellfires that awaited him.

Voltaire's close contemporary Thomas Paine, also a Deist, fared terribly after his death. The author of The Age of Reason was rumoured to have died in absolute fearful agony, recanting both his faithlessness and much of his writing.

The slander was such that in 1876, Robert Ingersoll, in a speech in San Francisco, offered $1,000 in gold to the charity of choice of the editor of the New York Observer, Irenaeus Prime, if he could prove that Thomas Paine had died "frightened by the clinking chains of devils" and disowning all his previous words, as Prime had claimed.

Happily, having amassed a huge amount of evidence to the contrary, Ingersoll not only forced the newspaper to recant but also ensured they printed the words "Thomas Paine died a blaspheming Infidel" — high praise indeed. Rather less happily, though, it was mischievously reported in Britain that Prime's evidence had been so overwhelming that Ingersoll had been forced to pay up.

Probably the most celebrated case of all is that of Charles Darwin. The great evolutionist died on 19 April 1882, at the age of 73. As early as the following month, there were reports of clergymen announcing from the pulpit that Darwin had undergone a deathbed conversion and renounced evolution. Many different stories circulated as to how this came about, the most famous involving the intercession of a certain 'Lady Hope'.

A story published in America claimed she had visited the very ill Darwin at his home in the autumn of 1881. Darwin supposedly became troubled by her reading of the creation account in Genesis, and asked her to return the next day to speak with him and the rest of the household about Jesus.

Darwin biographer James Moore, of the Open University, does not dispute these claims, even going so far as to identify Lady Hope as one Elizabeth Reid Cotton, an evangelist who made many visits to the sick in the Kent area at the time. What he would contest, though, is the implication that Darwin had recanted his evolutionist theories and embraced the church — a claim strenuously denied by his family.

Francis Darwin wrote to Thomas Huxley on 8 February 1887, that a report that his father had renounced evolution on his deathbed was "false and without any kind of foundation", and later affirmed that he had 'no reason whatever to believe that he [his father] ever altered his agnostic point of view'. Darwin's daughter Henrietta went further, writing in The Christian in 1922: "I was present at his deathbed. Lady Hope was not present during his last illness, or any illness. I believe he never even saw her, but in any case she had no influence over him in any department of thought or belief. He never recanted any of his scientific views, either then or earlier …. The whole story has no foundation whatever." The issue is slightly confused by the fact that Darwin was given a full Christian burial, and interred at Westminster Abbey. However, this probably has more to do with his and his family's keenness to be seen as pillars of society than any deepheld belief.

One person who was probably not especially concerned with being viewed as a pillar of society was Anton LeVay, founder of the modern American Church of Satanism. LeVay was, unsurprisingly, deeply hostile to religion, although it should be noted that the title of his 'church' is a slight misnomer, the beliefs he espoused being far more Nietzschean than actually Satanic. Yet the Christian rumour mills couldn't fail to be drawn to claim the soul of LeVay, by all accounts a deeply unpleasant character.

Shortly after his death in 1997, the usual rumours abounded about the arch–Satanist (or, as some saw him, the arch self–publicist) finding peace in the arms of the Lord on his deathbed. These accounts seem to stem entirely from the fact that he was taken to a Catholic hospital when he fell suddenly ill — studiously failing to mention the more likely explanation that it just happened to be the nearest hospital. Nonetheless, LeVay's deathbed recantation has now been fully absorbed into clerical myth. Even now his followers are faced with the slightly eccentric challenge of having to defend his name by insisting he remained evil to the very end.

As long as the devout continue to need affirmation by claiming new souls, and non–believers continue to keep dying, these anxious myths are going to persist. No doubt we'll find ourselves fuming at future obituaries reporting Richard Dawkins embracing the Bible, or Jonathan Miller's refutation of reason.

Of course, one solution to all this has presented itself in the recent debate over the Mental Capacity Bill. Living wills could include a statement of one's belief, or lack thereof, which one wishes to be taken into account should one be incapacitated, or hectored in a weakened state into some sort of profession of faith.

Maybe then we could put an end to this ignoble tradition.

Dr James Moore will be giving the British Humanist Association Darwin Day lecture at the London School of Economics on 11 February. See www.humanism.org.uk for details