Seven fire crews, including from Polmadie, Glasgow, rushed to The George pub in Causeyside Street, Paisley, at 3.30am yesterday.
Officers said the fire had reached "extreme temperatures" and was producing large volumes of smoke. No-one was injured but the flats were seriously damaged.
Homes were evacuated and staff from Renfrewshire Council were called to work in the middle of the night to help people find temporary homes.
Two families made their own arrangements.
George McGrandles, Strathclyde Fire and Rescue area commander, said firefighters prevented the flames from spreading and damaging the many adjoining properties.
At the height of the blaze seven fire appliances ranging from Paisley and Renfrew to Polmadie tackled the blaze.
A council spokesman said: "Building standards officers from the council and surveyors from the owner's insurance company will be assessing the damage and will decide if the building needs to be demolished."
Council leader Mark Macmillan said: "We are thankful everyone is safe.
"Housing officers will offer support, advice and assistance to those who have lost their homes, helping with their medium to longer term housing needs.
"Our town centre team will liaise with local businesses affected by the blaze and our roads service will do all it can to minimise disruption to traffic."