Rescuers are continuing to search the rubble of a building that collapsed while under construction in a Cambodia beach town, killing at least 25 workers as they slept in the unfinished structure.

The seven-storey building collapsed on top of the dozens of construction workers who were sleeping on the second floor.

The building was being put up in the thriving seaside resort town of Sihanoukville, which has several such Chinese-funded projects.

Cambodia Building Collapse
Rescuers try to remove the rubble at the site in Preah Sihanouk province (AP)

The Chinese embassy expressed its condolences and said it is mobilising assistance for the rescue.

Preah Sihanouk provincial authorities said rescuers digging through the twisted metal and concrete rubble found five bodies overnight and another on Monday morning, raising the toll to 25.

Up to 75% of the debris has been removed from the site.

Cambodian prime minister Hun Sen visited the site late on Sunday.

Cambodia Building Collapse
The workers had been sleeping inside the building (Cambodian National Police/AP)

At least 24 workers were injured in the collapse. One of them, Nhor Chandeun, said he and his wife were sleeping when they heard a loud noise and felt the building vibrate then begin falling down. They were trapped for 12 hours before rescuers found them.

The ministry of labour and vocational training said 30 workers were at the site when the building collapsed, but Nhor Chandeun said there were about 55 to 60 people inside the building.

Provincial authorities said four Chinese nationals involved in the construction have been detained while the collapse is investigated.