More than 30 people have died in the worst floods to hit Serbia and Bosnia in more than a century, with thousands evacuated from towns still under threat from rising rivers.

Thousands of volunteers joined soldiers, police and firefighters in building flood barriers made of sandbags in the Serbian capital Belgrade and the western town Sabac.

The Sava River hit its highest recorded level in Serbia, the army said, rising at a rate of three centimetres per hour after several days of the heaviest rainfall in almost 120 years.

Authorities in Serbia said they would not give a death toll for the town of Obrenovac, with a population of about 30,000 people, until the waters had receded and the extent of the damage was clear.

Soldiers have deployed huge amphibious vehicles to rescue hundreds of people crammed into a primary school in the town, 30 kilometres south-west of Belgrade.

A Reuters photographer said the entire town centre was submerged under two to three metres of water.

Tens of thousands of homes in Serbia were cut off from electricity and around 150,000 in Bosnia, where the north-eastern town of Doboj suffered the most.

"It was especially difficult in Doboj because the floodwaters acted as a tsunami, three to four metres high. No-one could have resisted," Serb Republic police chief Gojko Vasic said.

In Belgrade, residents donated food, clothes and bedding while police appealed for more boats.

More rain has been forecast for the region.

Time to wait and hope, says Serbian prime minister

About 10,000 people will be evacuated from Bosnia. ( Reuters: Dado Ruvic )

"Now we have to sit and wait, to wait for that next wave and to hope," Serbian prime minister Aleksandar Vucic told a joint news conference with Bosnian Serb leader Milorad Dodik.

In the Bosnian border town of Bijeljina, authorities said they would evacuate 10,000 people.

"We left behind the car, motorcycle, tools, all our furniture, valuables," Dragana Ilic, an Obrenovac resident evacuated to a shelter in Belgrade, said.

"We just grabbed our mobile phones and left. All our IDs were left behind. The whole house is under water."

In Bosnia, helicopters evacuated people from the northern towns of Samac and Modrica and trucks and bulldozers carried food to the hardest hit areas.

About 1,000 people, including babies, pregnant women, invalids and the elderly were evacuated from the region of Zeljezno Polje in central Bosnia, where hundreds of homes were destroyed in landslides.

"I think we'll never be able to return to our village," local Zuhdija Ridzal said. "It has disappeared."

"Only three houses survived, all others were buried, totally gone," villager Ragib Menzilovic said.

A landslide and floodwaters around houses in the village of Topcic Polje, near the central Bosnian town of Zenica. ( AFP: Elvis Barukcic )

Reuters