CAIRO — The Coptic church was so close to the apartment where a family of believers lived in a working-class neighborhood of Cairo that the parents couldn’t imagine anything happening to their three children when they walked together to attend Mass or school there.
But that sense of security came crashing down around the family on Sunday, when Edward el-Sayed made his way into the smoking ruins of the Abu Sefein Church and found his children curled up motionless behind the altar — three of the 41 victims of a devastating fire.
Fadi el-Sayed, a boy aged 10, and his sisters, Jumana el-Sayed, 9, and Mary el-Sayed, 5, were among 18 children killed in the fire, which raced through the modest church in the densely packed neighborhood after a generator exploded, said the children’s aunt, Mary Hosni.
“My darlings hid behind the altar because they were scared,” said Ms. Hosni, 27, speaking outside a wake for the children in a church hall on Monday. “They were waiting for someone to save them.”
The children’s mother, Huweida Hosni, sat at the wake with her eyes closed and her head back against the wall as a priest spoke about the children returning to God. Her surviving child, a 16-year-old girl, held onto her mother’s arm.
Mary Hosni, a college student, said neither of the parents had been at the Mass on Sunday but that the children went almost every day to the church, which also housed a community center where Mary attended day care.
She showed a photo of her nephew, posing with a serious expression on his face in what seemed to be new clothes. “He loved to draw,” she said. One of her nieces, wearing a big smile, twirled in a black and white skirt.
“They were very quiet kids — like angels,” she said, her eyes filling with tears. “They loved to pray. The two girls loved to help their father and bring him things.”
The Rev. Moussa Ibrahim, a spokesman for the church, said all of the children who died on Sunday were between 5 and 13 years old. He said the fire originated with an electrical generator used at the church, which like many Coptic houses of worship, was in poor repair, according to witnesses. He said he could not provide further details about the blaze while the fire was under investigation.
The Copts have long complained about being the victims of discrimination on the basis of their religion. One aspect of that discrimination are government restrictions on the construction, renovation and repair of churches in the largely Muslim country. These restrictions have left many of the buildings in disrepair and made them fire hazards.
However, faulty wiring is also common in Egypt and other countries in the region, as are devastating fires. There appeared to be no emergency fire exits at the church, witnesses said, which could have added to the death toll.
Father Ibrahim, the church spokesman said Abu Sefein had originally been licensed as a smaller service building and then recently given permission to operate as a church.
President Abdel Fattah el-Sisi, who is supported by many Egyptian Christians because they feel he is a bulwark against Islamist groups who might threaten them, introduced a law in 2016 intended to overhaul regulations preventing many churches from being licensed. But it gives authority to provincial governors, who have refrained from granting licenses in some cases in which they feel they would stoke sectarian tensions, according to some church officials.
After Sunday’s fire, Mr. Sisi’s government announced payments for the families of the victims and sent the army to repair the church.
Prime Minister Mostafa Madbouly said on Sunday that the families of victims would receive payments worth about $5,000 for each person killed and about $1,000 for each one injured.
On Monday evening, church pews and chairs removed from the damaged building were piled up on a nearby street corner while laborers watched over by soldiers continued to remove debris from the four-story building. One worker loaded debris from the building onto a cart pulled by an emaciated white donkey.
The scorched white cross on the roof had already been scrubbed clean on Monday, but a workman in bare feet dangled from scaffolding repainting the dark brown and tan building.
In the closely knit, impoverished Cairo neighborhood where the fire started, Muslim residents were among those who helped to rescue the fire’s survivors. Muslim residents said their Christian neighbors were an important part of the community, and lamented the deaths on Sunday, which included the bishop who was saying mass at the service, Abdul Masih Bakhit.
“He would always send sweets during the Christian holidays,” said Seif Ibrahim, a Muslim carpenter who lived near the church, referring to the bishop. “They were respectable people.”
There has been far less friction between Muslims and Christians in Cairo than in other parts of Egypt where there are larger proportions of Christians. In Minya Province, south of Cairo, churches in some villages are under police protection to prevent attacks by Muslim residents.
Egypt’s Coptic Christians are particularly observant. Ms. Hosni, whose nieces and nephew died in the fire, said the children had been fasting for a holy day they planned to celebrate at the Abu Sefein church — named after a third century Christian martyr who was tortured and killed in what is present-day Turkey. The church holds relics of the saint, who was a Roman army commander who had converted to Christianity.
On Sunday night, the Coptic community struggled with the enormity of the tragedy; there were so many victims that funerals, long processions of mourners wailing next to white coffins, had to be held at two separate churches on Sunday.
Salwa Sadek, a member of Cairo’s Coptic community, said at a preschool at another church, she once taught three of the 18 children who died — an 8-year old girl and her 5-year-old brother, and another boy, 8.
“I couldn’t believe this really happened,’’ said a distraught Ms. Sadek.
“The situation is very difficult,” said the Rev. Daoud Ibrahim, another Coptic priest, who officiated over 17 of the funerals at the Virgin Mary and Archangel Michael Church in the nearby al-Warraq neighborhood. “In situations like this you don’t know what to do.”
It was not immediately clear where the children had died, but some witnesses described saving some children from the floor above the sanctuary, where the nursery and classrooms were located. The church spokesman, who was not in Cairo when the fire started, said they had all died in the sanctuary itself.
The fire broke out as worshipers were gathering for a Mass in the small building, where the generator was in use after power had been cut. When the power came back on, witnesses said, the generator exploded, followed by the explosion of an air-conditioning unit, setting off a blaze that tore through the four-story church and started a stampede of worshipers.
Most of the deaths and injuries resulted from smoke inhalation and the stampede, Egypt’s Health Ministry said.
The tragedy also raised questions in a country whose government has long been criticized over its lax safety standards and poor oversight. The country’s chief prosecutor, Hamada el-Sawy, said he had ordered an investigation into the fire.
Father Ibrahim, whose Virgin Mary and Archangel Michael Church is known as the site of both a miracle declared by the Coptic church — a 2019 apparition of the Virgin Mary — and a tragedy — the drive-by shooting of a wedding party in 2013 — said those who died in the fire are considered martyrs now.
“They came to pray,” he said, to give offerings to God, “and they became the offerings.”