NEWMARKET — A four-alarm blaze damaged a subsidized housing complex late Friday afternoon and temporarily displaced 17 people, many of them children.

Nearly 50 firefighters from more than a dozen communities battled the blaze that broke out just before 4 p.m. in the Great Hill Terrace apartments at 2 Gordon Ave.

The complex is owned by the Newmarket Housing Authority.

Deputy Fire Chief Evan Bonney said one firefighter suffered a laceration and was treated at the scene. No other injuries were reported.

Bonney said the cause of the fire remains under investigation and that investigators from the state Fire Marshal’s Office were called in to assist.

Bonney said firefighters found fire on the outside of the rear of the building at Unit 6. He said firefighters extinguished the fire on the outside and once they moved inside they discovered that flames had made their way into the attic space and the walls of the building.

A total of four apartments were damaged. Bonney said two of the apartments sustained fire damage while all received smoke and water damage.

“We’re just really fortunate that the fire walls are as strong as they are between the sections of the building,” said Ernie Clark, the housing authority’s executive director.

Clark said 11 children and six adults have been displaced by the fire.

The apartments are uninhabitable, Bonney said, adding that the Red Cross and St. Mary Church were assisting the families.

Bonney said there were about six residents inside the building at the time of the fire and all were able to escape without injury.

The fire was brought under control shortly before 5:30 p.m.