A fire broke out in the Thorntree Inn pub in Ossett after a kitchen appliance was accidentally left on overnight.
Firefighters from Wakefield and Ossett stations were called to the Queen Street pub at around 7am on Sunday.
The kitchen and part of the roof was alight and the main pub was smoke logged. Nobody was in the pub at the time and people living upstairs had already escaped by the time firefighters arrived.
Watch commander Paul Graham said: “The pub has working smoke detectors fitted and they alerted people in the upstairs accommodation to the fire. “It was a pure accident - somebody had switched something on instead of turning it off and it caused the fire.”