Rustam Pakaya, head of the health ministry crisis centre, said that the flash flood submerged around 400 houses in water up to two metres deep in some places, following hours of heavy rain.
"It rained very heavily for several hours yesterday. The lake overloaded with water and the dam broke," he said.
"Right now residents are being evacuated. About half of them are still on rooftops waiting for help."
The dam was holding about two million cubic metres of water on the Pesanggrahan river.
Al Jazeera's Davies said the waters had begun to recede but thick mud was hampering rescue teams.
"Very intensive rescue efforts are going on here ... but the conditions are very difficult. People are walking through neck-high mud, it is incredibly hard to find people," he said.
"The conditions here are so treacherous, the water so high in places and it is so hard to get a footing, that the death toll is bound to rise almost certainly."
Rescue officials say they fear the death toll could rise much further because the dam collapsed when many people were asleep.
Some residents said it felt like they had been hit by a "mini-tsunami".
"It was like being in the middle of a tsunami," Minu, a local resident told Detikcom, a news website.
"People were screaming 'the water's coming in, the water's coming in,' and our dog was barking. I could hear our door being pounded on and I wondered who could it be, but it was the water."
|Thick mud is hampering rescue teams
as waters begin to recede [Reuters]
Some people living near the dam said they heard sirens before the disaster occurred, others were caught completely off guard.
An investigation will be carried out to learn what caused the disaster.
But Wahyu Hartono, a former official at the ministry of public works, said the 10 metre high dam has been poorly maintained in recent years because of budget shortfalls.
"We need to find a way to take better care of these Dutch-era dams and
dikes,'' he said.
"Otherwise, there will be more problems like this in the future.''
Floods and landslides are common in Indonesia during the wet season, which falls around the northern hemisphere's summer.
In 2007, floods in the capital left more than 50 people dead. Critics said overdevelopment, poor city planning and clogged drainage canals were partly to blame.