“They had heavy fire showing on the third floor, up through the roof,” DiBenedetto said.

Steve MacDonald, a department spokesman, said two people were taken to the hospital for smoke inhalation.

Dylan Durning, 29, and ­Evan Dooley, 28, evacuated their apartment at 265 Sumner St. when they became aware that the roof of their building was on fire.

“Everyone’s out,” said Dooley, while sitting on a heated bus with his roommate, their dog, and other residents from the building. “We hope our apartment wasn’t affected.

The Fire Department said “heavy fire” was reported between the second and third floors.

The fire, which occurred on a block of closely located structures, appeared to be knocked down by 12:15 a.m. Tuesday, with firefighters searching for hot spots on the roof and inside the structure, which suffered heavy damage on the third floor.

MacDonald said officials were investigating the cause. He said that damages were estimated at $600,000.

At the scene, Rene Hernandez said in Spanish through a translator that he and his wife rushed out of the building with their son, who was wrapped in a Spider-Man blanket, and that neighbors were crying outside.

Erasmo Gomez, 17, said he ran out of his second-floor apartment when the fire started and alerted the nearby firehouse.

“I can’t even talk,” said Gomez, who was wrapped in a blanket at the scene. “I’m freezing, I’m scared. I’m scared to go back to my house.”

He said that when he ran to the firehouse he was also ­praying for his family and his puppy, who all made it out safely.