The fire that destroyed a three-unit apartment building at 689 Main St. Tuesday night was started by a young boy playing with matches or a lighter.

When firefighters arrived at the building, less than a half mile from the central fire station, flames were pouring from the windows, said Public Safety Chief Michael Pardue. Pardue credited the firefighters from Westbrook and surrounding communities with keeping the fire from spreading to an adjacent building, about 10 feet away.

“When the first arriving units pulled up it was very, very evident they had a large fire that had the potential to spread further down a block of buildings,” Pardue said. The on-duty captain struck a second alarm immediately and the third alarm within about a minute.

The fire melted siding on 691 Main St. but there was no structural damage, he said.

Investigators with the State Fire Marshal’s Office combed through the burnt remains of the first floor apartment Tuesday night and early this morning and determined that the fire started with a preschooler, younger than 5, playing with matches or a lighter in a family room, Pardue said.

One person was taken to the hospital as a precautionary measure for suspected smoke inhalation, he said.

Officer Chris Burgess, who was near the building when the fire broke out, helped a second-floor resident escape from the fire, Pardue said. Pardue said he did not know whether that was the person who was taken to the hospital.

All the other residents of the building got out safely and are being helped with shelter, clothing and other necessities by the American Red Cross.

Firefighters from Portland, Scarborough, Gorham, Windham and Falmouth responded to the call for mutual aid.