Twenty people have been killed and 47 injured after a car bomb collided with other vehicles, triggering an explosion outside a cancer hospital in central Cairo.

The blast occurred around midnight local time on a road running alongside the Nile River in an area outside Egypt’s National Cancer Institute. Pictures taken just after the incident and published by Egypt’s largest newspaper, Al-Ahram, showed two burnt-out cars, with at least one completely blackened and dented from the force of the explosion.

Egypt’s interior ministry said a car carrying explosives drove into oncoming traffic and collided with three others, detonating its charge. It named Hasm, a violent offshoot of the Islamist Muslim Brotherhood group, as the organisation responsible for the attack, and said a member of the group had been arrested in connection with the blast.

“I was waiting to use a bathroom inside the hospital around 12.30am when I heard a big explosion,” said Nermat al-Awady, who had travelled to the cancer centre from Minya so her child could receive treatment. Awady had intended to sleep outside the hospital with her child before queuing for treatment the following morning. “We ran to the main entrance of the hospital but it was on fire, so we left through another side door,” she said.

“I saw body parts and lots of blood,” she said, adding that she believed the fire had burned for an hour. “Inside the hospital, there was panic. Women and children were screaming and running. The hospital stairs are normally crammed with people, so it was hard to escape.”

Egypt’s ministry of health said it dispatched 42 ambulances to the site to attend to the wounded, who had sustained burns and cuts. Four remain in intensive care. About 45 patients were evacuated to other hospitals.

A ministry spokesman initially said it had recorded 19 deaths as well as “a bag of body parts”. Cairo police said they were searching the Nile for additional victims who may have fallen in during the attack.

In the morning, police and security officials watched over patients accessing the institute, where twisted metal, possibly from the bumper of a car, hung from the damaged facadeand broken glass and tiles covered the surrounding pavement. The explosion tore letters from the institute’s sign, and warped a metal frame outside.

The damaged facade of the National Cancer Institute. Photograph: Mohamed Hossam/EPA

The Egyptian president, Abdel Fatah al-Sisi, issued a statement offering condolences to the victims, and condemning the attack. “The Egyptian state is determined to confront acts of terrorism and uproot them, with all its institutions,” he wrote.

A parked car exploded in the central Dokki neighbourhood of Cairo last August, injuring at least three people. Egyptian officials speculated that a faulty car battery sparked the explosion, causing a fire that damaged a nearby minibus.

A series of violent explosions shook the Egyptian capital in 2015, including a car bomb that destroyed part of the Italian consulate adjoining Cairo’s Tahrir Square and a blast targeting a security building in the northern Shubra al-Khaima neighbourhood. In 2014, four blasts in one evening killed six people and injured 80 in downtown Cairo in a string of attacks targeting police.

Islamist militants have systematically targeted police and security institutions since the violent overthrow of the former president Mohamed Morsi in 2013, including a car bomb that fatally struck the motorcade of the top prosecutor, Hisham Barakat, in one of the highest-profile assassinations in the country’s history.

In February 2018, Sisi launched what he promised would be a comprehensive operation to “clear Egypt’s territory of terrorist elements”, focused on the restive northern Sinai peninsula, Egypt’s western desert and Nile Delta. The operation began two months after gunmen and explosions targeted a mosque in northern Sinai, killing 305 people.

Additional reporting by Adham Youssef