The Sudanese military says rebels have shelled the capital of South Kordofan state near the border with South Sudan, killing five civilians and wounding more than 20 others.

Sudanese military spokesman Col. Sawarmy Khalid told The Associated Press that rebel forces fired "about eight" shells Monday, six kilometers (3.5 miles) outside the town.

Rebels confirmed the attack but denied any casualties, saying in a statement that they targeted "military installations" in the town in response to "extensive shelling" by government forces in areas of the state the rebels claim to control.

The United Nations Humanitarian Coordinator for Sudan condemned the "indiscriminate mortar attack" in a statement.

Violence erupted in South Kordofan last year, shortly before South Sudan declared independence under a deal that ended decades of civil war.