The Notre Dame Cathedral fire was able to burn undetected for 30 minutes because of critical mistakes made by church employees — and the historic building came close to collapsing entirely, a new report claims.

When a fire alert first rang out on the night of the April 15 blaze, a church guard inspected the wrong building — and another guard who had been on the job for just three days then dismissed the alert as a false alarm, the New York Times investigation published Wednesday claims.

By the time employees realized their mistake half an hour later, the fire in the 850-year-old Gothic cathedral was already burning out of control — and the building was only saved from total destruction thanks to the heroic efforts of 500 firefighters, according to the report.

A flawed fire response plan also underestimated how quickly a fire would spread in the 13th-century building’s wooden attic — where no sprinklers or fires walls had been installed to protect the landmark or firefighters, the report claims.

“The whole outcome of it is this clumsy human response,” Glenn Corbett, an associate professor of fire science at John Jay College of Criminal Justice in New York, told the Times.

“You can spend a lot to detect a fire, but it all goes down the drain when you don’t move on it.”

When the fire alarm first sounded at 6:18 p.m., the church’s new security guard — who was working a double shift — radioed another guard to investigate if there was actually a fire.

But the guard went to the wrong place — checking the attic of a neighboring building instead of the main cathedral. When no one could locate the fire, the security guard assumed the blaze was a false alarm, according to the report.

A manager finally figured out the mistake and sent the guard to the correct location at 6:48 p.m., but by then, the massive blaze was already too large to be put out by a fire extinguisher.

The mix-up has produced what the Times called a “bitter round of finger-pointing over who was responsible for allowing the fire to rage unchecked for so long.”

When crews from the Paris Fire Brigade began arriving at 7 p.m., the landmark was engulfed in flames, the report said.

“I felt useless, ridiculously small. I just felt powerless,” firefighter Myriam Chudzinski, one of the first on the scene, told The Times.

The building came close to collapsing, but a dozen firefighters risked their lives to save the two bell towers, which threatened to bring down the entire building.

“At that point, it was clear that some firefighters were going to go into the cathedral without knowing if they would come back out,” Ariel Weil, the mayor of Paris’ 4th Arrondissement, said.

The cause of the massive blaze is still unknown — with investigators looking at the possibility of a worker discarding a burning cigarette butt or a short-circuit in the electrified bells of the spire.

Fundraising efforts to rebuild the church, which was undergoing much-needed renovations at the time of the blaze, have topped $1 billion.

French President Emmanuel Macron has promised it would be rebuilt within five years — but architects have warned reconstruction efforts could take decades.

The employee of the security company reportedly received death threats in the wake of the fire.

The cathedral — which was visited by up to 14 million people a year — remains closed and under police guard.