A fire that raged for three hours through a Bangkok slum near the Australian and German embassies has destroyed thousands of people's homes.

The blaze, which sent a pall of thick, black smoke towering into the sky, broke out in a densely populated area packed with wooden homes.

A five-storey block of flats next to the slum was also destroyed.

Desperate residents could be seen spraying homes with water from garden hoses to stop the fire from spreading and emptying the contents of their homes in a bid to save a few possessions.

Officials said there had been no reports of casualties and no clues to the cause of the blaze.