Is it ever okay to deny Christ?

It's a commonplace to say that the Islamist movement that has swept over Iraq and Syria has taken the region back into the Dark Ages. We can argue about the history, but we know what people mean. It's a dark fundamentalism which offers no compromise, no tolerance and no mercy: you submit or you die.

Islam is not the only religion to have cast such a deep shadow. When President Barack Obama had the temerity to point out that Christians have a pretty chequered past too, referencing the Crusades and the Inquisition, he was roundly condemned by conservatives: religious violence was what other people did, not what Christians did. Obama, of course, was entirely correct and his critics were either historical illiterates or playing the sort of dog-whistle games that so disfigure American politics.

Muslims and Christians are both suffering today. Islamic State and other extremists kill Muslims for not being Muslim enough, or for not being the right kind of Muslim. They kill and enslave Christians just for being Christians.

In the Westgate Mall attack in Nairobi in 2013, al Shabaab gunmen announced that all Muslims could come forward and identify themselves and they'd be allowed to leave.

One man who got away was Joshua Hakim, who covered up the forename on his ID as he showed it to them. He's actually a Christian. Some Kenyans have begun to share information about how to pretend to be Muslim, including learning to recite the shahada – the Islamic declaration of faith – in Arabic.

But how far should Christians go in order to save their lives? Franklin Graham recently said that they should simply accept martyrdom. He's not alone. A Christianity Today article drew together responses from various Arab and African theologians. In Kenya, David Oginde, head of the 45,000-member Christ is the Answer Ministries, said "A true Christian must be ready to live and to die for the faith."

On the other hand, Samuel Githinji, a theology lecturer at the Anglican St Paul's University in Nairobi, says the answer isn't clear-cut and that reciting the shahada doesn't amount to denying Christ: "Christians are obligated to save their lives and others' lives as much as possible. Denying the faith is more subtle than the mere voicing of certain words."

Azar Ajaj, president of Nazareth Evangelical Theological Seminary, cites the case of a Coptic Christian in Libya who fled for his life. He grew a proper beard and carried a prayer rug, and covered the Coptic tattoo on his wrist with a fake cast. Ajaj says: "It is okay to pretend to be a Muslim, but not to lie and say so."

George Sabra, president of Near East School of Theology in Lebanon, believes that Christians should not say the shahada but that those who do deserve compassion. He says: "To be a Christian is not about learning tactics for survival. But denying Christ is not an unforgivable sin. We may not despair of God's love and mercy. Even Peter, the head of the disciples, was a denier of Christ."

The actions of Islamic State and other extremist groups have revived questions that were first addressed in the heat of persecution by the early Christians. That their story is still so relevant today is a bleak commentary on the myth of human progress, but it has much to teach us. It has recently been brilliantly retold by Marcellino D'Ambrosio (Who Were the Church Fathers?, SPCK), on which I have drawn for this account.

At its heart is Cyprian, from Carthage in North Africa, who was baptized in 246 AD and became a bishop shortly afterwards. He was a warm and generous man whose gifts were to be sorely needed.

In 250 AD, the Emperor Decius unleashed a new wave of persecution against the Church. All citizens had to obtain a certificate saying that they had sacrificed to Caesar and the gods. Pope Fabian was martyred within three weeks. Many others perished during the 14 months of the onslaught. Cyprian went into hiding, but when he returned he found that many of his flock had compromised. Some had sacrificed, while others had bought forged certificates saying that they had.

There was a crisis in the North African Church. It had not previously accepted lapsed Christians back into fellowship, but now there were too many of them. Some still thought they should never be admitted, others thought they should be welcomed straight back, others only on their deathbeds. There were also conflicts arising from the status of those who had maintained their faith under torture and survived, with some saying that they outranked the bishops.

The controversy even struck at Rome, with a priest named Novatian leading a schism on the pretext that Fabian's successor Cornelius had granted absolution to some of those who had lapsed.

Cyprian made a passionate appeal for unity. His fellow bishops agreed to follow his advice and avoid extremes. Those who had compromised their faith could be restored, but only after penance and genuine repentance.

This was not the end of the story, or the end of the schism – and it was certainly not the end of the persecutions. Cyprian himself was beheaded in 258 AD.

Another North African theologian, Augustine, also had to face the problem. The Emperor Diocletian launched the Great Persecution from 303-11; Christian books were burned, their property was confiscated and they were tortured, mutilated, burned, starved and sent to the arena to amuse spectators.

So again, what was the Church to do?

One problem was what counted as apostasy. Obviously if you sacrificed to a pagan god you were apostate. But what if you handed over scriptures to the police? Or if you handed over writing you said were scriptures but weren't?

Some saw all these acts as equally guilty. The hard-liners – who came to be known as the Donatists, after their leader Donatus – argued that any compromise was wrong and tainted the apostolic succession from bishop to bishop. Augustine, though, believed that the Church would always be a mixed community of saints and sinners until God's final judgement. He wanted to find room in it for people who had failed and fallen.

Today, Christians in the Middle East and in Africa face the same life-and-death dilemmas Christians faced more than 1,500 years ago. The judgement of the Church then was that it was right for them to try to save their lives, though not at any price. But it also said that God was merciful and that no one was barred from returning to the Church even if they had denied Christ.

The incidence of Christian persecution today is tragically high. It's not for anyone to pass judgement who has never known it. But the hard-won wisdom of the early Christians encourages us to pray for those who suffer and to be loving and gracious to those who fail.