BROCKTON, Mass. (WPRI) — Fire officials say a candle was to blame for a house fire in Brockton that sent several people to the hospital on Sunday.

According to the state fire marshal’s office, crews were called to Central Square just before 1 a.m. They arrived to find heavy flames coming from the top two floors of the triple-decker and people hanging from third-floor windows.

Five people were rescued with ladders, officials said, and seven in total were taken to the hospital with “varying injuries.”

It took about an hour to get the fire under control.

The cause was determined to be a candle that ignited flammable items on a bedside table.

State Fire Marshal Peter Ostroskey and Brockton Fire Chief Brian Nardelli urged people to be careful when using candles and to consider other options.

“Candles cause about 100 fires each year in Massachusetts. Almost all of them take place in people’s homes, and almost all of them can be prevented by using extra caution,” Ostroskey said. “Even better, try battery-powered alternatives, like flashlights for emergencies and flameless candles for decoration and celebration. They’re much safer than an open flame.”

“If you use candles at home, please remember to keep anything that can burn at least a foot away on all sides,” Nardelli added. “Always place them on a sturdy, nonflammable saucer or candleholder. And never leave a burning candle unattended – always blow it out before you leave the room or go to sleep.”