A building at 585 Congress St. in Portland was temporarily evacuated Saturday morning after a gas leak was detected.

The Portland Fire Department evacuated about 20 people from apartments in the building near Congress Square after the odor of gas was detected at 8:45 a.m. in the basement of Paul’s Foods, which is in the lower level of the building.

Workers from Unitil repaired the leak, according to Acting Deputy Fire Chief John Everett, and residents were allowed back in their homes by early afternoon.

A Unitil spokesman said early Saturday evening that the line had been repaired.

Everett said the leak came from an underground line in the street and could have been caused by shifts in the line caused by underground freezing and thawing.

The evacuated residents initially took shelter in a METRO bus parked nearby but later were moved elsewhere, Everett said.

Traffic was briefly blocked on Congress Street.