BERLIN -- Twenty-five people were injured, four of them severely, when an explosion destroyed an apartment building in the western German city of Wuppertal, police said Sunday.

Police said the explosion rocked the several-story building shortly before midnight Saturday with a large bang, scaring people in surrounding homes so much they ran out into the street in a panic. The detonation was so severe it destroyed the building's attic and the top three floors, the German news agency dpa reported. The blast left a large hole where the building used to be, BBC News reported.

A house is destroyed after an explosion in Wuppertal, Germany, June 24, 2018. Henning Kaiser / AP

Fire then broke out in several different parts of the apartment building and firefighters had trouble dousing the flames because parts of the building kept collapsing. They were able to rescue four severely injured from inside the building and sent them to the hospital. Another 21 people were slightly injured and treated by emergency staff at the scene.

Get Breaking News Delivered to Your Inbox

Police said Sunday they were still trying to get the fire under control and were investigating the cause of the explosion. They would not comment when asked if the explosion could possibly be terror-related.

A car nearby was destroyed, buried under window frames that were blown onto it by the impact of the explosion. Emergency personnel on Sunday picked up bricks and furniture on the street from the explosion.

Some of the building's roof beams stood black and eerie in the smoke as police scoured accessible parts of the building for further people trapped inside before giving the all-clear.

The place where the building stood is now a huge gap in a row of apartment buildings in the city's Langerfeld neighborhood.