A raging fire swept through the upper levels of a 32-story office building in downtown Madrid (search) early Sunday, causing no serious injuries but collapsing the top floors in a shower of flaming debris.

Bright orange flames shot out the sides of the Windsor Building (search), which is near one of Madrid's main boulevards and was believed to have been empty.

The fire started around 11:30 p.m. Saturday and was still burning out of control several hours later. At least nine upper stories were on fire and muffled explosions could be heard in the building.

After gutting the top of the building, the flames worked their way downward. Officials had hoped a thick reinforced concrete plate at the 17th floor might halt it, but the fire kept going. About six-and-a-half hours after it started, the fire was still raging.

The cause of the blaze was not immediately known, but emergency services spokesman Javier Ayuso said it might have been a short circuit.

City officials were afraid the building might collapse entirely.

"At this point the fire can't be fought and we have to wait," said Pedro Calvo, the official in charge of the fire department and other emergency services.

Firefighters and police evacuated nearby buildings and streets for fear of a total collapse. Firefighters also started hosing down neighboring office buildings to keep the fire from spreading.

Ayuso said three firefighters were treated for smoke inhalation and exhaustion.

Construction of the Windsor Building — a landmark in Madrid's business district — began in 1973 and was completed in 1979. It was surrounded by scaffolding due to recent repairs, Ayuso said.

The building housed the offices of Deloitte Touche Tohmatsu, a multinational financial services company.