A joint fire service and police investigation is under way after 47 guests and a number of staff fled to safety as flames ripped through a hotel.
The first floor of the Gateway To Wales Hotel in Deeside on the North Wales border was destroyed by the blaze, while 80% of the ground floor was severely damaged, said fire chiefs.
Emergency services were called at about 4.30am on Monday and seven fire engines and four ambulances rushed to the scene in Welsh Road.
Most of the guests had already managed to escape before crews from North Wales Fire and Rescue Service arrived.
Two aerial ladder platforms and a high volume pumping unit were used to help douse the roof space of the building. Two roofs surrounding the reception entrance were partially collapsed.
Those evacuated from the hotel and the flats are being looked after at a local rest centre.
Structural engineers are expected to assess the safety of the building while fire investigators wait for the site to be made safe before they enter.
Stuart Millington, senior operations manager at the fire service, said: "Crews attended very quickly and in numbers as the fire was very well developed by the time we arrived.
"At the height of the fire there was approximately 60 people (firefighters) on the scene.
"Crews worked very hard to bring the fire under control and to all intents and purposes it is out and just being dampened down now.
"The cause of the fire is still under investigation and will take place with our colleagues from the police.
"Our fire investigators are speaking to local residents and to people in the building. The building is quite badly damaged and therefore their abilitiy to get in and take their investigation safely will take some time."
He added: "The early operation of the fire alarm system is what gave the early warning to allow people to make their escape ... so that's clearly testament to the value of a properly functioning smoke alarm and fire alarm system."
Flintshire County Councillor Christine Jones, who lives nearby, said: "It's a lovely hotel. It's been here 20 years or so and is really well used by locals and guests from other areas.
"It's absolutely devastating and a real loss to the area but thankfully everyone got out safely."