The explosion, which occurred in a building on Toledo Street, caused widespread damage, according to video footage tweeted by Madrid City Hall’s Emergency Information Service, Emergencias Madrid.
Pictures of the scene showed that part of the outer wall had been torn down from several floors of the building and the rooms were exposed. Debris covered parked vehicles and the street below, and a mangled metal street sign appeared on the floor.
At least four floors are affected by the explosion and firefighters are evacuating people from the area, the service said.
The building could be in danger of collapsing, the Mayor of Madrid, José Luis Martínez Almeida, told journalists. “Different people are treated differently (for injuries),” he said.
Those killed were an 85-year-old woman and a man whose age was not immediately known, an ambulance spokesman told CNN. Two of the injured were taken to hospital, one suffered from a broken ankle, he said.
Seniors who lived in a nursing home next to the building where the explosion took place or in a neighboring school were not injured, the spokesman said.
Martínez-Almeida urged caution as the authorities learned more details after the explosion. “It appears that there was a gas explosion,” he said.
The Archdiocese of Madrid said the building belongs to the Church of the Virgin of Paloma and San Pedro el Real, which is next door, and has been “completely destroyed”.
“Two priests are in good condition and one was taken to hospital. We are trying to find someone who was there when the explosion occurred,” the archdiocese said in a statement.
Police are on site, a spokesman for the Spanish National Police told CNN.
All residents of the nursing home have been evacuated, said Los Nogales residence director Antonio Berlanga.