Police have appealed for witnesses to come forward following a suspicious fire outside a block of flats at Seton Court, Kennoway.
It is thought to have started around 2.00 am on Sunday.
The fire started at a discarded mattress placed outside the block of eight flats - and quickly spread to the gas meter boxes situated on the building.
Sergeant Robert Gassner said: “The consequences could have been catastrophic with the gas boxes at the front of the flats having caught fire. Gas engineers attended and were able to seal off the gas supply to the area.
“Fortunately no-one was injured as a result of the fire but houses had to be evacuated.”
Anybody with information regarding this fire is asked to contact Police Scotland on 101 or Crimestoppers on 0800 555 111 where all calls are treated anonymously.