Law and order has collapsed in much of Darfur, where mainly African tribes took up arms in 2003 against the Arab-led government in Khartoum, which they accuse of discriminating against them.
Violence has surged since January as government forces, rebels and Arab tribes, armed by Khartoum early in the conflict, fight over resources and land. Peacekeepers often get attacked when they try to find out what is happening on the ground.
A large group of unknown gunmen attacked a patrol in an area in South Darfur where peacekeeping is the responsibility of Tanzanian forces, the African Union/United Nations-led UNAMID force said. Reinforcements managed to rescue the peacekeepers after an "extended firefight".
Two of the 17 wounded soldiers and police officers were female, UNAMID said. It did not give nationalities, but a UN source said most casualties were probably Tanzanians.
UN Secretary-General Ban Ki-moon was "outraged" by the attack, his press office said in a statement.
"The secretary-general condemns this heinous attack on UNAMID, the third in three weeks, and expects that the government of Sudan will take swift action to bring the perpetrators to justice," the statement said.
The site of the attack is close to Nyala, Darfur's biggest city, where competing security forces fought for days last week, looting the main market and offices of aid agencies, witnesses said.
Diplomats say the more than 16 000 peacekeepers are struggling with equipment problems, poor training of some contingents and the reluctance of some governments like Egypt to send their soldiers into dangerous areas.
The force has no joint command, which hampers coordination and rapid deployment to hot spots.
About 300 000 people have been forced to leave their homes in Darfur this year by fighting, according to the United Nations.
The International Criminal Court has issued arrest warrants for Sudanese President Omar Hassan al-Bashir and some aides on charges of masterminding war crimes in Darfur. They deny the charges and refuse to recognise the court.
Reports from Darfur are hard to verify as Sudan severely restricts travel by journalists, aid workers and diplomats. – Reuters