The director of The Exorcist has revealed that he was allowed to film a real exorcism at the Vatican.

“I was invited by the Vatican exorcist this month to shoot and video an actual exorcism which … few people have ever seen and which nobody has ever photographed,” William Friedkin told a masterclass at the Cannes film festival.

The 80-year-old American film-maker said he was taken aback at how close the ceremony was to the exorcism depicted in his 1973 film.

“I don’t think I will ever be the same having seen this astonishing thing. I am not talking about some cult, I am talking about an exorcism by the Catholic church in Rome,” he said.

The Vatican did not immediately respond to a request for comment.

The director said he intended to shoot The Exorcist – based on a bestselling novel by William Peter Blatty – as a horror film, but the more he learned the more it became a supernatural tale instead.

While the book was based on the 1949 case of an American teenager called Roland, Friedkin said the Catholic “archdiocese of Washington DC asked Blatty to change the gender (in the novel) so as not to draw attention to the young man”.

But in reality, the director said, “it was a young man of 14, not a girl” who was allegedly possessed.

William Friedkin during his film masterclass in Cannes. Photograph: Julien Warnand/EPA

The film recounts the demonic possession of a 12-year-old girl and her mother’s attempts to win her back through a rite conducted by two priests.

Friedkin said he believed the boy was genuinely possessed. “I’m convinced that there was no other explanation. I read the diaries not only of the priest involved (in the exorcism), but the doctors, the nurses and the patients at Alexian Brothers hospital in Saint Louis where this case was carried out,” he added.

“Everything having to do with medical science and psychiatry was attempted. This young man suffered from afflictions very similar to what’s in the film, as hard is that is to believe.”

The exorcism scenes in the film have been repeatedly voted among some of the scariest shown in cinemas.

“When I started I thought I was making a horror film and then the priest, who was the president of Georgetown University (in Washington DC), let me read these diaries and I knew that it was not a horror film,” Friedkin said. “This was a case of exorcism.”

“I believed in this story,” Friedkin told the audience in Cannes, referring to the original possession of the boy. “I made this story as a believer. I’m not Catholic, I don’t to church, I don’t belong to a church or a synagogue.

A scene from the 1973 horror classic. Photograph: Moviestore Collection/Rex

“I do believe in the teachings of Jesus,” Friedkin added, whose parents were Jewish immigrants from Ukraine. “I believe they are incredibly profound and beautiful and we know that this character existed … the supernatural aspect I leave to each person’s conscience and belief system.

Friedkin, who also made The French Connection, was – along with Francis Ford Coppola and Peter Bogdanovich – one of the leaders of the “New Hollywood” group of film-makers in the early 70s.