In Dan Brown’s new thriller, Origin, we are introduced to the Catholic church’s sinister far-right rival — a paranoid worldwide cult dedicated to undermining the reforms of Pope Francis.

This toxic outfit has its own pope, who runs it from his ‘Vatican’ at El Palmar de Troya, on the Andalusian plain; hence its name, the Palmarian Catholic church. Brown describes a ‘soaring Gothic cathedral’ dominated by ‘eight towering spires, each with a triple-tiered bell tower’. Inside, members are required to attend interminable masses and pray to hundreds of freshly created saints, including St Adolf Hitler.

Origin is a clumsily fashioned thriller, even by Brown’s standards, and you might imagine that he invented the Palmarian church. But it’s real. Not only does it have a pope — Peter III, the fourth pontiff since the church separated from Rome in 1978 — but the cathedral at El Palmar de Troya is much as he describes it.

The ceremonies are indeed lavish and the vestments gorgeous. According to Professor Magnus Lundberg of Uppsala University, whose book A Pope of their Own is the only authoritative study of the Palmarians, at the height of the church’s fortunes its many cardinals and bishops ‘kept some of the finest jewellers and embroiderers in Andalusia busy for years’.

This isn’t to say that Brown tells the truth about the Palmarians. They haven’t canonised Hitler. Franco is more their cup of tea. In 2014, a statue of ‘St Francisco Franco’ appeared outside their basilica, but had to be removed because monuments to the Generalissimo are illegal in Spain.

Their creepiness, however, is not in doubt. On YouTube you can find a video of the first Palmarian pope, Gregory XVII, who died in 2005, experiencing a vision in 2001. He kneels, bowing on the floor of his basilica, surrounded by prelates in towering mitres, some of whom are strikingly handsome young men. When he lifts his chubby face to heaven you see he has no eyeballs.

Pope Gregory, previously an insurance broker from Seville called Clemente Domínguez y Gómez, lost his eyes in a car accident in 1976. Ironically, at the time he had made himself ‘principal seer’ for a group of Spanish schoolgirls who claimed to have seen the Virgin Mary near El Palmar de Troya in 1978, though they disowned him. That same year, he began styling himself a bishop of the Catholic church — a claim easy to dismiss but for one inconvenient detail. Two years earlier, before his accident, he had been ordained bishop by the Roman Catholic Archbishop Ngo Dinh Thuc, older brother of the assassinated President Diem of South Vietnam.

During the 20th century there were hundreds of small quasi-Catholic denominations run by episcopi vagantes or ‘wandering bishops’. Unlike Gregory, these self-styled prelates, many of them English, had nothing resembling a basilica. They had to make do with a disused chapel or, failing that, their living room. Space was always a problem: it’s hard to carry off a 50ft purple cape if it keeps getting tangled up with the coffee table.

These episcopi vagantes could produce complicated pedigrees ‘proving’ that they were Catholic bishops because their orders derived from a valid source — for example, the ‘Old Catholic’ see of Utrecht, which broke from Rome in the 18th century. Gregory, by contrast, had been ordained by an exiled archbishop who, at the time, was still in good standing with Rome.

To say that it went to his head is putting it mildly. When Pope Paul VI died in 1978, Domínguez y Gómez announced that he had been ‘mystically crowned’ pope by Christ. To quote Lundberg: ‘Pope Gregory did not only claim universal spiritual power, but universal temporal power, too: he would become the emperor of the coming Hispanic--Palmarian Empire and great caudillo of the faithful warriors in the fight against Antichrist and the conquest of Russia.’

Pope Gregory set about creating cardinals at a rate of knots. Also, although deploring the doctrinal innovations of the Second Vatican Council, he turned out to be no mean innovator himself.

Palmarian Catholics — who flocked to his services in numbers that are still hard to explain — were taught that the Virgin Mary as well as Christ is present in the Eucharist.

The Palmarians have prophesied the end of the world for several different years: like most apocalyptic groups, they are quick to adjust the deadline when the end time fails to begin. When it does happen, however, they will be assisted by the inhabitants of ‘the Planet of Mary’, home of angels who have been transported from earth.

Brown writes about a worldwide network of Palmarians. This doesn’t exist, but during the 1980s Gregory did have followers all over the world — in every Catholic country on mainland Europe, in Latin America, Nigeria, the Philippines and Australia.

There were some Palmarian churches in Britain but they were dwarfed by Gregory’s following in Ireland. Presumably the extreme Mariolatry appealed to the Irish. Also, possibly, the short masses: there is a long Hibernian tradition of priests rattling through the liturgy at breakneck speed and Gregory cut back the mass to its essentials.

At El Palmar de Troya, priests were required to get through 16 masses an hour. But this brevity was offset by papal sermons lasting several hours. Gregory enjoyed his booze and (as he shamelessly confessed) his boys. His dwindling flock, however, were deprived of even the most basic facilities, to the point where the smell inside Palmarian convents was described as ‘overpowering’.

Things were already falling apart before he died. The third pope, Gregory XVIII, increased the bullying of members — and then, in April 2016, performed a spectacular volte-face by resigning to marry his girlfriend and announcing that the whole Palmarian church was ‘a fraud’.

These days the Palmarians are a sad bunch; Brown is feeding on their misery. But, after they die out, other sects will take their place, and in greater numbers than we would have anticipated a few years ago.

Religion generally is moving to the fringes; Christianity in particular is increasingly centred on sub-Saharan Africa, where self-styled archbishops daily receive messages from heavenly beings. Whatever the future holds for the region, there will always be plenty of work for the embroiderers of pontifical vestments.

Damian Thompson discusses the Palmarian Catholic Church on The Spectator Podcast.

Like most apocalyptic groups, they are quick to adjust the deadline when the end time fails to begin