An apartment building fire in Auburn that left about 40 residents homeless Friday morning was started by a 6-year-old boy playing with a cigarette lighter, the Maine State Fire Marshal’s Office said.

The fire at 46 Fourth St. was reported shortly after 8 a.m., Auburn fire officials said. The building is a four-story apartment building.

It took firefighters about an hour to get the fire under control. A firefighter was treated for a shoulder injury, but no residents were injured.

According to the fire marshal’s office, the boy set the fire on his bed in a fourth-floor apartment. He then went and told his mother, who was in another room.

Fire officials said the fourth floor of the building had extensive fire and smoke damage and the third floor had water damage. The first and second floors had less damage, but it’s not clear when repairs will be made and when residents will be able to get back to their apartments.

The boy will be referred to a juvenile fire-setter prevention program, said Stephen McCausland, spokesman for the Maine Department of Public Safety.