On Saturday, Thammasala Police Station was alerted about a fire in Krisda Nakhon 31 Village on Boromratchonnanee Road of Thawi Watthana district.
Police and firefighters rushed to the scene and needed around an hour to extinguish the fire at a three-storey house in the village.
While officials were working to rescue the residents, the building collapsed and trapped an unknown number of officials and residents under it.
Five people, including the four firefighters, were killed.
Rescuers managed to pull the four bodies out of the debris by 6.40am on Sunday after an all-night operation.
The fifth fatality was an office worker.