The Portland branch of the YMCA reopened a dormitory late Thursday after a small fire threatened to displace 31 men who have been staying there.

While officials at the YMCA were seeking alternative housing after the fire, the Portland Fire Department ultimately declared the space to be safe and habitable and residents were able to return to the dorm.

The small fire started Thursday afternoon at the YMCA of Southern Maine’s Greater Portland branch at 70 Forest Ave. The fire was contained to the Y’s housing support services program known as the GROW (Giving Opportunity for Wellbeing) program. The program provides temporary shelter in one-week increments to men transitioning from homelessness to stable housing.

The fire department quickly contained and extinguished the fire and there were no injuries.

After the space was deemed to be safe, the YMCA reset sprinkler and alarm systems and staff members and a cleaning company removed all the water, smoke and ash. The YMCA is still waiting for a financial assessment of the damage, but praised the fire department, agency staff and the Red Cross.

The cause of the fire has not yet been determined, according to the YMCA.

The YMCA’s Greater Portland branch remains open, and the wellness facilities, youth programming, and meeting rooms were unaffected by the fire.