PARIS — The security employee monitoring the smoke alarm panel at Notre-Dame cathedral was just three days on the job when the red warning light flashed on the evening of April 15: “Feu.” Fire.

It was 6:18 on a Monday, the week before Easter. The Rev. Jean-Pierre Caveau was celebrating Mass before hundreds of worshipers and visitors, and the employee radioed a church guard who was standing just a few feet from the altar.

Go check for fire, the guard was told. He did and found nothing.

It took nearly 30 minutes before they realized their mistake: The guard had gone to the wrong building. The fire was in the attic of the cathedral, the famed latticework of ancient timbers known as “the forest.”

E V A C U A T I O N CHURCH GUARD SECURITY EMPLOYEE CHURCH GUARD CHURCH GUARD SECURITY SUPERVISOR FIRE DEPT. Sacristy Presbytery 0 minutes after alarm The fire was in the attic of the cathedral, the famed latticework of ancient timbers known as “the forest.” The guard went to the attic of a small adjacent building, the sacristy. Instead of calling the fire department, the security employee called his boss but didn’t reach him. The manager called back and eventually deciphered the mistake. He called the guard: Leave the sacristy and run to the main attic. But by the time the guard climbed 300 narrow steps to the attic, the fire was burning out of control, putting firefighters in a near impossible position.

The miscommunication, uncovered in interviews with church officials and managers of the fire security company, Elytis, has set off a bitter round of finger-pointing over who was responsible for allowing the fire to rage unchecked for so long. Who is to blame and how the fire started have not yet been determined and are at the heart of an investigation by the French authorities that will continue for months.

But the damage is done. What happened that night changed Paris. The cathedral — a soaring medieval structure that has captured the hearts of believer and nonbeliever alike for 850 years — was ravaged.

Today three jagged openings mar Notre-Dame’s vaulted ceiling, the stone of the structure is precarious, and the roof is gone. Some 150 workers remain busy recovering the stones, shoring up the building, and protecting it from the elements with two giant tarps.

Some of what went wrong that night has been reported in the French news media, including Le Monde and Le Canard Enchaîné. Now, The New York Times conducted scores of interviews and reviewed hundreds of documents to reconstruct the missteps — and the battle that saved Notre-Dame in the first four critical hours after the blaze began.

What became clear is just how close the cathedral came to collapsing.

The first hour was defined by that initial, critical mistake: the failure to identify the location of the fire, and by the delay that followed.

The second hour was dominated by a sense of helplessness. As people raced to the building, waves of shock and mourning for one of the world’s most beloved and recognizable buildings, amplified over social media, rippled in real time across the globe.

That Notre-Dame still stands is due solely to the enormous risks taken by firefighters in those third and fourth hours.

Disadvantaged by their late start, firefighters would rush up the 300 steps to the burning attic and then be forced to retreat. Finally, a small group of firefighters was sent directly into the flames, as a last, desperate effort to save the cathedral.

“There was a feeling that there was something bigger than life at stake,” said Ariel Weil, the mayor of the city’s Fourth Arrondissement, home to the cathedral, “and that Notre-Dame could be lost.”

Thierry Mallet/Associated Press

Precious Time Lost

Paris has endured so much in recent years, from terrorist attacks to the recent violent demonstrations by Yellow Vest protesters. But to many Parisians, the sight of Notre-Dame in flames was unendurable.

“For Parisians, Notre-Dame is Notre-Dame,” said its rector, Msgr. Patrick Chauvet, who watched in tears that night as firefighters struggled to tame the blaze. “They couldn’t think for one second that this could happen.”

The fire warning system at Notre-Dame took dozens of experts six years to put together, and in the end involved thousands of pages of diagrams, maps, spreadsheets and contracts, according to archival documents found in a suburban Paris library by The Times.

The result was a system so arcane that when it was called upon to do the one thing that mattered — warn “fire!” and say where — it produced instead a nearly indecipherable message.

It made a calamity almost inevitable, fire experts consulted by The Times said.

“The only thing that surprised me is that this disaster didn’t happen sooner,” said Albert Simeoni, an expert born and trained in France, but now head of fire protection engineering at Worcester Polytechnic Institute in Massachusetts.

The ponderous response plan, for example, underestimated the speed at which a fire would spread in Notre-Dame’s attic, where, to preserve the architecture, no sprinklers or fire walls had been added.

The plan’s flaws may have been compounded by the inexperience of the security employee, who had been working at Notre-Dame just three days when the fire broke out.

Stationed since 7 a.m. within the pale-green walls of the tiny presbytery room, he was supposed to have been relieved after working an eight-hour shift. His replacement was absent, so he was on the second leg of a double shift.

The control panel he monitored was connected to an elaborate system consisting of tubes with tiny holes that ran throughout the cathedral complex. At one end of each tube was what is called an “aspirating” detector, a highly sensitive device that draws in air to detect any smoke.

Pool photo by Christophe Petit Tesson

The message that scrolled across the monitor was far more complicated than the mere word “Feu.”

First it gave a shorthand description of a zone — the cathedral complex was divided into four — that read “Attic Nave Sacristy.”

That was followed by a long string of letters and numbers: ZDA-110-3-15-1. That was code for one specific smoke detector among the more than 160 detectors and manual alarms in the complex.

Finally came the important part: “aspirating framework,” which indicated an aspirating detector in the cathedral’s attic, which was also known as the framework.

It remains unclear just how much of that entire alert the employee understood or conveyed to the guard — and whether the critical part of it was relayed at all, though Elytis insists it was.

By the time it was sorted out, the flames were already running wild, too high to be controlled by a fire extinguisher.

Finally, the guard radioed the fire security employee to call the fire department. It was 6:48, 30 minutes after the first red signal lit up the word “Feu.”

All the sensitive technology at the heart of system had been undone by a cascade of oversights and erroneous assumptions built into the overall design, said Glenn Corbett, an associate professor of fire science at John Jay College of Criminal Justice in New York.

“You have a system that is known for its ability to detect very small quantities of smoke,” Mr. Corbett said. “Yet the whole outcome of it is this clumsy human response. You can spend a lot to detect a fire, but it all goes down the drain when you don’t move on it.”

A Global Spectacle

If it took more than half an hour to call the fire department, it took just minutes once smoke appeared for the images to begin circulating around the world on social media.

“I think Notre-Dame is burning,” someone posted on a Twitter video at 6:52 p.m. Within just a few minutes, the smoke, blowing west with the wind, was so thick it started to obscure the towers.

Minutes earlier, at 6:44, Elaine Leavenworth, a tourist from Chicago, had taken a picture of the facade against a clear blue sky. By the time she took a short walk across Pont Saint-Michel, she smelled smoke. She looked back to see the towers engulfed in smoke, and took another shot.

“Frightening how quickly it changed,” Ms. Leavenworth posted on Twitter at 6:55 p.m., along with the two photos.

Monsignor Chauvet, the rector, had been chatting just a couple of hundred yards from the cathedral with shopkeepers, when suddenly one of them pointed up and exclaimed: “Look, there is smoke coming out!”

A sinking feeling took hold. “I said to myself: ‘It’s the forest that’s caught fire,’” Monsignor Chauvet recalled, referring to the cathedral’s attic.

He pulled out his cellphone and warned his staff. They said the fire department had been called but had yet to arrive.

“I was incapable of doing anything,” Monsignor Chauvet said. “I couldn’t say anything. I watched the cathedral burn.”

Mr. Weil, the mayor of the Fourth Arrondissement, was just leaving a long meeting at the nearby Hôtel de Ville, the city hall, when he saw the smoke and ran toward Notre-Dame.

He called the mayor of Paris, Anne Hidalgo, and she rushed to meet him. When they reached the plaza, tears were streaming down Monsignor Chauvet’s face. Ashes and fiery flakes drifted through the air.

“It was like an end-of-the-world atmosphere,” Mr. Weil recalled.

On the plaza, the gathering crowd was stunned, immobilized.

“I cried because you are helpless to do anything,” Monsignor Chauvet said. “You wait for the firefighters.”

Francois Mori/Associated Press

A Firefighter’s View

By the time Master Cpl. Myriam Chudzinski arrived, a few minutes before 7 p.m., Notre-Dame was surrounded by hundreds of horrified bystanders. The fire already glowed through the roof.

Corporal Chudzinski, 27, had wanted to be a firefighter since she was a little girl. Now she was staring speechless at a kind of blaze she had never encountered.

Her truck stopped on the Rue du Cloître Notre-Dame, a narrow street that runs on one side of the cathedral. The building was so gigantic, she couldn’t see where the fire was spreading anymore.

“We were so small that it was hard to get a proper idea from the bottom of the cathedral,” she said. “But it might have been better like that.”

Better not to know the danger she was walking into.

Corporal Chudzinski’s team was one of the first to arrive, and headed to the attic. The firefighters immediately plugged their hoses into the cathedral’s dry risers, empty vertical pipes that would allow them to pump water up to the flames.

Bearing 55 pounds of gear and a breathing pipe on her shoulder, Corporal Chudzinski climbed the dark staircase in the transept on the cathedral’s north side.

She knew the structure well, having drilled at Notre-Dame last fall. As she climbed, she recalled that the attic had no firewalls to prevent the spread of a blaze — they had been rejected to preserve the web of historic wooden beams.

With such intense flames, she realized, the attic would be a tinderbox.

Aside from the drill, Corporal Chudzinski had visited the cathedral once a few years ago, marveling at its vastness. “It was so peaceful, so quiet,” she said. “But that night, it was more like hell.”

Master Cpl. Myriam Chudzinski Dmitry Kostyukov for The New York Times

Once at the top, Corporal Chudzinski and her team stopped on a cornice outside the attic as she took the lead dousing the flames, about 15 feet away.

Her colleague holding the hose behind her could see that the flames were being pushed by a brisk wind toward the cathedral’s northern tower. The fire was starting to surround them, threatening to trap them outside, in the middle of the inferno. They retreated inside, toward the attic.

There was no wind there. But the air was so hot, so barely breathable, that for the first time that night, Corporal Chudzinski plugged in her breathing apparatus. Her thirst was terrible.

In the attic, the flames advanced as an unstoppable wall. They covered countless beams already and nibbled up the floor. Pieces of wood frayed and fell from the timbers one by one.

About 7:50, almost an hour into the fight, a deafening blast engulfed her. It was, she said, like “a giant bulldozer dropping dozens of stones into a dumpster.”

The 750-ton spire of the cathedral, wrought of heavy oak and lead, had collapsed. The blast was so powerful it slammed all the doors of the cathedral shut. The showering debris broke several stone vaults of the nave. Corporal Chudzinski and other firefighters happened to be behind a wall when a fireball hurtled through the attic. It probably saved them. “I felt useless, ridiculously small,” she said. “I was just powerless.” The generals overseeing the operation called everyone back. Some 50 firefighters, including Corporal Chudzinski and her team, were ordered to come down. They battled the fire from the ground, drawing water from the Seine. But it wasn’t working. Before the blast, Corporal Chudzinski and her colleagues had made a critical observation: The flames were endangering the northern tower. The realization would change the course of the fight. Inside that tower, eight giant bells hung precariously on wooden beams that were threatening to burn. If the beams collapsed, firefighters feared, the falling bells could act like wrecking balls and destroy the tower. If the northern tower fell, firefighters believed, it could bring down the south tower, and the cathedral with it.

Video by Xavier Guillerm

Touch and Go

Near 8:30 p.m., President Emmanuel Macron arrived to survey the damage, along with Prime Minister Édouard Phillippe and other top officials.

A group of about 20 officials, including Mayor Hidalgo, Mayor Weil and Monsignor Chauvet, convened across the plaza at Police Headquarters for a briefing by Gen. Jean-Claude Gallet, the head of the Paris fire brigade.

Clad in firefighting gear, dripping with water, General Gallet, 54, had served in Afghanistan and specialized in crisis management. He entered the conference room and gave them the bad news.

The attic could no longer be saved; he had decided to let it go. He would have his brigades throw all their energy into saving the towers, focusing on the northern one, already on fire.

“He came in and told us, ‘In 20 minutes, I’ll know if we’ve lost it,’” Mr. Weil recalled. “The air was so thick. But we knew what he meant: He meant Notre-Dame could collapse.”

“At that point,” Mr. Weil added, “it was clear that some firefighters were going to go into the cathedral without knowing if they would come back out.”

Veronique De Viguerie/Getty Images

Monsignor Chauvet wept. The prime minister circled his thumbs nervously.

President Macron remained silent, but appeared to give tacit approval to General Gallet’s decision.

Out on the square, a temporary command post had been set up. There, General Gallet’s deputy, Gen. Jean-Marie Gontier, was managing the firefighters on the front lines.

He gathered them around him to prepare for the second stage of the battle. A slippery carpet of ashes covered the stones underfoot in black and gray.

The situation looked grim. Whiteboards displayed sketches of the fire’s progress. Police drone footage showed the cathedral’s roof as a fiery cross illuminating the night sky. At the center was a gaping hole where the spire had stood for more than 160 years.

Scenes From a Firefighter’s Notebook For all the high-tech gear available to big-city fire departments, investigators still see value in old-school tools. These drawings were made by a French firefighter and professional sketch artist, Laurent Clerjeau, as the cathedral burned, and in the days afterward. They show how the flames spread, and record what firefighters did to try to contain them. Laurent Clerjeau

Thick smoke was billowing from the wooden frame of the northern tower. Thumb-size embers flew like glittering hornets and pierced some hoses. One of the dry risers needed to get water to the top of the cathedral was leaking, lowering the water pressure.

Now, all that time lost because the firefighters had been called late was exacting its toll. General Gontier compared it to a footrace. “It’s like starting a 400 meters, several dozen meters behind,” he said.

Gabriel Plus, the Paris fire brigade spokesman, said, “We needed to make decisions, quickly.”

At the command post, Master Sgt. Rémi Lemaire, 39, had an idea.

What if they went up the stairs in the southern tower, where he had been earlier in the fight. That way, they could carry up two additional hoses that could be plugged directly into a fire truck. It would give the team more water pressure than the leaking riser could muster.

And then from there, the firefighters could enter the blazing northern tower.

It was a high-risk strategy. But General Gontier agreed.

No Way Out

Sergeant Lemaire had already seen the perils that the northern tower held earlier that evening. In the time it took to decide on the new plan, things had gotten only worse.

“We were at first reluctant to go because we weren’t sure we’d have an escape route,” he recalled.

A group of firefighters from a neighboring suburb refused to go, but another team said it would do it.

They moved forward with their plan to save the northern tower, which was already aflame. Sergeant Lemaire led them up the southern tower, and they set up on a platform between the two towers. He and his team dropped hoses over the side to connect to a fire truck on the ground, hoping to get more pressure than the leaking standpipe could muster. Another dozen or so firefighters doused the flames that threatened to collapse the floor beneath them. Others held back flames on the roof. The gigantic bells above their heads could tumble down at any moment. They needed to work quickly. The firefighters moved higher, the structure ever more precarious as they went. But they kept going, up another floor, closer to another set of bells. It took them 15 decisive minutes, but by 9:45 p.m. the flames were tamed.

General Gontier went up on the balcony of Notre-Dame to inspect the situation.

“She is saved,” he declared as he descended.

By 11, General Gallet told officials they were confident that the fire in the towers would be brought under control. Around 11:30, President Macron addressed the nation live on television from in front of the cathedral.

“The worst was avoided, even though the battle is not yet over,” he said. Then he made a pledge: “We will rebuild this cathedral together.”

The Finger-Pointing

Over the past three months, investigators have conducted some 100 interviews and sifted the rubble, looking for clues to what started the fire.

They have focused on the possibility of a short-circuit in the electrified bells of the spire, or in the elevators that had been set up on the scaffolding to help workers carry out renovations. They are also considering cigarette butts, which were found on the scaffolding, apparently left by workers.

“We’re not ruling out any scenario, we just know it wasn’t criminal,” said a Paris police official, speaking on the condition of anonymity because the investigation is still underway.

The miscommunication that allowed the fire to rage unchecked for so long is now the source of a bitter dispute over who is responsible.

Church officials say that the employee for Elytis, the fire security company, never mentioned the framework of the cathedral’s roof. “Several of them had a walkie-talkie and all heard ‘Attic Nave Sacristy,’” said André Finot, a spokesman for Notre-Dame. “That’s all.”

Monsignor Chauvet, Notre-Dame’s rector, has refused to make the employees available independently for interviews, citing the investigation. “Some might lose their jobs,’’ he said. “I asked them not to talk.”

Arnaud Demaret, the chief executive officer of Elytis, said his employee was still in shock. The company received two death threats over the telephone in the days after the fire, he said.

But he insisted that his employee had communicated the fire’s location properly.

“There is only one wooden framework,” Mr. Demaret said in an interview. “It’s in the attic.”

“Had the church employee gone up to the attic right after my employee alerted him,” he said, “he would have seen the smoke.”

Benoit Tessier/Reuters

A Lesson in Fragility

After the fire was brought under control, Sergeant Lemaire and his colleagues stayed up on the roof to put out the flames there and protect the southern tower, where three small fires had started.

Corporal Chudzinski spent the rest of the night helping make space for other fire trucks and securing the area. Then she went back to her station. The city was quiet.

She remembered her retreat, and the drone footage showing the cathedral from above as a flaming cross. Only then, when she was no longer absorbed in fighting the fire, did she fully comprehend the scope of the response.

“I didn’t know how huge the teamwork had been,” she said.

Miraculously, no one was killed.

Three days later, she and Sergeant Lemaire were among the hundreds of firefighters and police officers honored by President Macron at the Élysée Palace.

Countless Parisians stopped by the city’s fire stations to donate food and small gifts and express their thanks. Notes came from around the world.

“These people were heroes,” Mayor Weil said.

Still, more than a few wondered why at a time when citizens were taking to the streets protesting inequality and economic hardship, when so many were dying in distant wars and on migrant boats sailing for Europe, should Notre-Dame matter.

But Notre-Dame was more than a building. It rests on Île de la Cité, the island in the middle of the Seine River where Paris was born. Made and remade over the centuries, it remains a focal point of French culture that has responded to the demands of each age it has passed through.

And in the present moment, it represented an unbreakable link with what, for many French, is the essence of their increasingly fragile nationhood.

“Notre-Dame is good and old: Perhaps we’ll even see her bury Paris, whose birth she witnessed,” the poet Gérard de Nerval once said.

That was back in the 19th century.

That sense of the cathedral as a living, wounded entity has only intensified since the fire.

“First off, this is all about our fragility,” Monsignor Chauvet, the rector, said on reflection. “We are as nothing. The fragility of man, in respect to God. We are nothing but — creatures.”

Dmitry Kostyukov for The New York Times

Aurélien Breeden and Constant Méheut contributed reporting from Paris. Produced by Mona Boshnaq, Allison McCann, Andrew Rossback, Gaia Tripoli and Jeremy White. Additional work by Michael Beswetherick and Bedel Saget.