As many as 40 people were displaced Sunday morning by a fast moving fire in Cambridge.

The blaze started in a vacant Cambridgeport triple-decker and quickly consumed two nearby multifamily homes. A fourth building was also charred by the nine-alarm conflagration that began at 156 Allston Street.

The gap between the buildings is described by authorities as “very narrow.” A woman named Margeret visiting from the Netherlands is now living with friends. She said she was awakened at 3:30 a.m. Sunday by frantic knocking and ringing of her doorbell.

Police and the Cambridge fire department are investigating to try to determine the cause of the fire.