Crews from Chesterfield and Staveley were called to Everett Close, in Brimington, Chesterfield, at around 0200 BST.
Firefighters using breathing apparatus put out the fire with three hose reels and also stripped the roof tiles.
An ambulance was needed for the occupants of the building who suffered shock, the brigade said.
News Feed from BBC News