An explosion at a nursing home collapsed part of the building and left people injured and trapped inside, authorities said.