Device to extinguish a fire produced in a building, characterized by having a bomb comprising a hollow body whose inner part carries a load of a fire-retarding component and an actuator that, when it hits the surface of the building, activates a detonator that makes the charge explode, scattering the fire-retarding component over the whole surface area of the radius of action, the detonator and explosive charge contained inside a receptacle and the detonator being connected by means of an electrical wire to one or various actuators installed on the surface of the body of the bomb.