Twenty people were killed and 47 injured when a car packed with explosives intended for a militant attack blew up outside Cairo’s main cancer hospital on Monday, the interior ministry said.

Officials initially said the explosion was caused when a car driving against the traffic collided with three other cars.

The front of the hospital suffered extensive damaged, with an entrance wrecked and rubble strewn over the pavement. Victims’ belongings were scattered among the debris.

The interior ministry said the car involved in the incident had been stolen a few months ago.

“The initial technical examination also showed that the car contained explosives, and the collision led to their detonation,” a ministry statement said.

“It is estimated that the car was being transported to a location for use in the execution of a terrorist operation,” the ministry added.

It said the Hasm militant group was responsible for rigging up the car.

Egypt accuses Hasm, which emerged in 2016 and has claimed several attacks, of being a wing of the outlawed Muslim Brotherhood. Egypt’s oldest Islamist movement denies this and says it seeks change through peaceful means only.

A woman cries as she walks past the damaged facade of the National Cancer Institute in Cairo. Photograph: Amr Abdallah Dalsh/Reuters

The explosion caused a blaze that forced the partial evacuation of the National Cancer Institute, the health ministry said.

One resident, who gave her name as Salwa, said bodies had been fused together by the explosion.

“There was a sound of an extremely loud blast. It was no way two cars crashing. The car must have been rigged with explosives,” she told Reuters Television.

Another witness, who declined to give his name, said the car’s driver ran away before it exploded.

Later in the morning, investigators scoured the scene amid a heavy police presence.

Egypt’s public prosecutor is investigating the incident, sources told Reuters.

President Abdel Fattah al-Sisi expressed his condolences to the Egyptian people and the families of the victims. He pledged to eradicate “this brutal terrorism”.

Egyptian security forces are waging a counterinsurgency campaign against Islamist militants, some with links to Islamic State, that is focused in the north of the Sinai Peninsula.

Attacks outside Sinai have become relatively rare, although there have been several security incidents in recent months in Giza, across the Nile from central Cairo.

In May, an explosion targeting a tourist bus injured at least 12 people, mostly South African tourists, near the Giza pyramids.

In December, three Vietnamese tourists and an Egyptian guide were killed, and at least 10 others injured when a roadside bomb hit their tour bus near the pyramids. – Reuters