SALEM, N.H. (CBS) – A restaurant and several apartments were destroyed in a huge fire in Salem, New Hampshire Wednesday morning that left two firefighters hurt.

Flames broke out around 5:30 a.m. inside the China Star restaurant on Main Street.

READ MORE: VIDEO: State Police Looking For Tractor-Trailer That Sideswiped Lieutenant On 495 And Didn't Stop

Flames tore through the restaurant and apartments Wednesday morning. (Photo credit: Salem, NH Police)

The fire department says there were ten apartments above, but all 17 residents escaped safely before the building collapsed.

Paul Parisi, the Salem Fire Chief credited the safe evacuation of building tenants to a pulled fire alarm. “The call came in by way of a fire alarm activation so when the fire alarm went off the people actually got out of the building and that’s what they should do. If it wasn’t for that that, it would’ve been a different circumstance,” Parisi said.

However, Fire Lt. Chris Hamilton and firefighter PJ Comeau were inside searching to see if anyone was trapped when a ceiling fell on them. A wood beam came down and struck both of them, one in the head, the other in the back. Fortunately they were able to pull each other out of the building.

As Parisi recalled, the firemen relied on their training to get out. “They’re in zero visibility. They’re in high heat. The fire was burning above them and beside them, to the point that it sounded like a freight train was in the room and then this collapse occurred. The lieutenant relied on his training immediately and called the mayday. It was muffled but fortunately the operations chief heard it,” Parisi said.

The two injured firemen were taken to Holy Family Hospital, treated and released.

READ MORE: Child Tax Credit: How Much Will You Get Each Month?

There’s no word yet on how the fire started, but police say its origins are not suspicious and that it likely began in the Chinese restaurant.

The rubble of the China Star restaurant on Main Street. (WBZ-TV)

“When I heard that there was a fire there I was like, ‘Oh my God,’ because that’s such an old building.  That’s been there for a long time,” Salem resident Edie Beede told WBZ-TV.

“It was up in flames, there was nothing but brown, black smoke.  You could see the orange flames from where I work, right over there, up over the bank,” said resident Julie Cameron, “Awful.”

Cameron spoke to the restaurant owner after the fire.

“I saw him this morning. He said that he saw it on the news, and that’s how he found out. Nobody called to tell him, he just heard it on the news,” she said.

MORE NEWS: Boston Mayor Kim Janey Says She's Strongly Opposed To Death Penalty 'For Dzhokhar Tsarnaev Or Anyone Else'

“I love Salem and to see some tragedy like this, it’s sad. Sad for everybody that’s involved in it,” said Beede.