The cause of the blaze, which started in a small attic and raged for about eight hours, is under investigation, Deputy Fire Chief Scott Cordio said.

Cordio said the building, which was the Columbia Hotel decades ago, will have to be torn down. The building at 65 Main St. contained more than 20 apartments and about 10 businesses, including a pizza restaurant, an arts center, and a branch of the Fitchburg-based Sentinel & Enterprise newspaper.

Two firefighters were hit with debris when a wall collapsed onto them. They were taken to the HealthAlliance Hospital in Leominster and ­later released with minor injuries.

“They got lucky,” Cordio said.

Tom Bartlett, 58, of Leominister said his son called to tell him about the fire Saturday night and he went to see what was happening. When he got there, he said, he saw flames 8 to 10 feet high and he watched as
a wall caved in, crushing ­several cars parked on the street.

“It was just an inferno,” he said.

Mazzarella praised Leominster firefighters for extinguishing the blaze and said there was nothing they could have done to save the building.

“This was too far gone,” he said of the building.

Leominster fire officials called in help from more than a dozen surrounding cities and towns, including Shirley and Fitchburg.

The fire displaced 35 residents from 65 Main St. and three residents from the adjacent building at 15 Columbia St., said Dawn Leaks, a spokeswoman for the American Red Cross of Central and Western Massachusetts, in an e-mailed statement.

Mazzarella said his number one priority is to find housing for those left without homes and he had already found a few vacant studio apartments nearby.

John Ham, 58, said his brother lived in the apartment complex on the second floor and he had lost all of his belongings. But he was grateful his brother was all right.

“At least he got out,” Ham said.

Ham said his brother told him that a fire alarm had gone off right away, and he quickly exited the building.

Linda Pinder, a trustee for the Leominster Historical Society, said the Columbia Hotel was built in 1892 and was frequented by salesmen as well as travelers who would rest at the hotel before continuing a trip to the mountains. A group of Freemasons also gathered there.

“It was for everyone,” Pinder said.

The Columbia was popular for its convenient location next to the train station and its then-contemporary design, she said.

Pinder said the building’s current owners recently ­restored Mason’s Hall, where the Freemasons had met. The ­design was beautiful, she said.

“You felt like you were right back there in the ‘30s,” which was when the hotel closed, ­Pinder said.

Dianne Eredita, 66, who lives in an apartment nearby, said that at 10 p.m. Saturday she noticed smoke billowing out of the building and firefighters trying to extinguish flames. But it just kept getting worse.

“Within 2½ hours the roof was pretty much engulfed in flames,” she said.

Jen Hemenway, a local cartoonist who displayed her work in the Leominster Art Center, said she had no idea if any of her art would be salvageable.

“I have no verdict yet,” she said. “But I’m expecting the worst.”

Hemenway, 39, said that the fire looked like a scene from a movie. The tenants living on the second floor barely escaped, she said.

“They got out by the skin of their teeth,” Hemenway said.

Lisa Marrone, of the Leominster Planning Department which helps oversee the Art Center, said officials are trying to find a new space for the artists.

The timing was especially bad for them, she said, because the holiday season is when they make the most sales.

“It’s a disappointment,” she said. “But we will reopen.”

Globe correspondent Jaclyn ­Reis and GalTziperman Lotan contributed to this report. Katherine Landergan can be reached at klandergan@globe.com.