A loud explosion apparently caused by a gas leak has partially destroyed a residential building in the center of Spain's capital on Wednesday, killing two people and injuring at least two more, according to officials.

The first images and footage shared on social media showed a tower of smoke coming out from the six-story building and rubble scattered in Toledo Street, near the city center. Emergency crews could be seen aiding several people on the ground.

CHINA GOLD MINE EXPLOSION: AT LEAST A DOZEN WORKERS STILL ALIVE AFTER BEING TRAPPED FOR A WEEK, REPORTS SAY

Mayor José Luis Martínez Almeida confirmed the two deaths to the Telemadrid news channel and said that the initial assessment was that the blast was caused by a gas leak.

A loud explosion of unknown origin has partially destroyed a six-floor-tall building flanked by a school and a nursing home in the center of Spain's capital, Madrid. (Europa Press via AP)

A nearby nursing home was evacuated although no injuries were initially reported among the residents, Martínez Almeida said. He said the residents were being taken to a hotel across the street.

Martínez Almeida also said that some mild damage had been identified in a nearby school. Spain's public broadcaster, TVE, said the school was thought to have been empty because classes had not resumed yet following a record snowfall in Madrid on Jan. 9.

Police officers cordon off Toledo Street following an explosion in downtown Madrid, Spain, Wednesday, Jan. 20, 2021. (AP Photo/Bernat Armangue)

In a tweet, the Madrid regional emergency service said that rescue teams, firefighters and police were working in a central area of the Spanish capital following the explosion.

Leire Reparaz, an area resident, told The Associated Press that she heard a loud explosion some minutes before 3 p.m. local when she was heading to her home near the Puerta de Toledo, a local landmark.

CLICK HERE TO GET THE FOX NEWS APP

"We didn’t know where the sound came from. We all thought it was from the school. We went up the stairs to the top of our building and we could see the structure of the building and lots of grey smoke," the 24-year-old Madrid resident said.

__

AP photographer Paul White contributed to this report.