More than 40 people were killed when a fire ripped through a Coptic Christian church in a working-class district of Greater Cairo during mass on Sunday, state and religious officials said.

The blaze, blamed on an electrical fault, hit the Abu Sifin church in densely populated Imbaba west of the Nile river, part of Giza governorate.

Witnesses described panicked scenes as people rushed into the multi-storey house of worship to rescue those trapped but were soon overwhelmed by the heat and deadly smoke.

"Everyone was carrying kids out of the building," said Ahmed Reda Baioumy, who lives next to the church. "But the fire was getting bigger and you could only go in once or you would asphyxiate."

The Egyptian Coptic Church and the health ministry reported 41 dead and 14 injured in the blaze before emergency services said they had brought the blaze under control.

President Abdel Fattah al-Sisi declared on his Facebook page in the morning: "I have mobilised all state services to ensure that all measures are taken."

He later said he had "presented his condolences by phone" to Pope Tawadros II, who has been the head of the Coptic Orthodox Church since 2012.

The Giza governor ordered "urgent aid of 50,000 pounds (around $2,600) for the families of the deceased and 10,000 pounds for the injured".

The grand imam of Al-Azhar, Egypt's foremost Muslim institution, expressed his condolences for "the tragic accident" and affirmed "the readiness of Al-Azhar hospitals to receive the injured".

The interior ministry said "forensic evidence revealed that the blaze broke out in an air-conditioning unit on the second floor of the church building" which also houses social services.

Father Farid Fahmy, of another nearby church in Imbaba, told AFP the fire was caused by a short circuit.

"The power was out and they were using a generator," he said. "When the power came back, it caused an overload."

Accidental fires are not uncommon in the sprawling megalopolis of Cairo, where millions live in informal settlements.

Baioumy, the neighbour, told AFP that fire-fighters were hampered by the fact the church is located "on a very narrow street" where buildings stand barely a few metres apart and fire engines can barely manoeuvre.

Egypt, with its often dilapidated and poorly maintained infrastructure, has suffered several deadly fires in recent years.

In March 2021, at least 20 people died in a blaze in a textile factory in an eastern suburb of Cairo.

In 2020, two hospital fires claimed the lives of 14 Covid-19 patients.

Last Monday a church caught fire in the eastern Cairo district of Heliopolis, though no deaths or injuries were reported.

Copts are the largest Christian community in the Middle East, making up at least 10 million of Egypt's 103 million people.

The minority has suffered attacks and complained of discrimination in the majority Muslim north African country, the Arab world's most populous.

Copts have been targeted in deadly attacks by Islamist militants, particularly after Sisi overthrew former Islamist president Mohamed Morsi in 2013, with churches, schools and homes burnt down.

Members of the minority also complain they have been left out of key state positions and they have deplored restrictive legislation for the construction and renovation of churches compared to that of mosques.

Sisi, the first Egyptian president to attend the Coptic Christmas mass every year, recently appointed the first ever Coptic judge to head the Supreme Constitutional Court, the country's highest.