The violence broke out as authorities tried to move the refugees, numbering some 23,000, mostly from southern Sudan, to a camp south of Khartoum, said the UN Office for the Coordination of Humanitarian Affairs (OCHA).
The demonstrators torched the local police station after seizing weapons with which they traded fire with the policemen, according to witnesses.
They said the police used firearms and tear-gas, while the refugees fought with spears as well as guns seized from police. Six police vehicles were torched, apart from the station, they said.
An OCHA official in the Sudanese capital, Kirsten Zaat, criticised what she called the government's heavy-handed policy of forced relocation and demolishing temporary homes.
"The UN laments this tragic and unnecessary loss of life and reminds the government of Sudan to meet its international legal obligations to guarantee the security and safety of all Sudanese civilians, including IDPs," she said.
Yassin Arman, spokesman for southern Sudan's main former rebel group, the Sudan People's Liberation Movement (SPLM), demanded an immediate investigation into the violence.