PORTLAND – A two-alarm fire heavily damaged the top story of a three-story apartment building on Grant Street on Wednesday afternoon.

Fire Chief Jerome LaMoria said all residents of the 19-unit building at 129 Grant St. got out of the building unharmed when the fire started shortly after 3 p.m.

He said it started either on the top floor or in a small attic space above the third story. The cause wasn’t immediately known, LaMoria said, and investigators will try to determine how it started.

The fire spread smoke over a large area of the Parkside neighborhood. Flames were still visible coming through the roof about a half-hour after it started, but firefighters had it knocked down by 4 p.m.

Dan Hoffman, the owner of the building and two adjacent buildings, said there were 40 tenants at 129 Grant St.

Both Hoffman and LaMoria said the building’s smoke detectors appeared to work and several tenants said they heard alarms going off.

Red Cross officials would help tenants find housing, LaMoria said.