The United Nations' humanitarian office did not specify when the attack took place or who was behind it, but said that the situation in the Kordofan region was continuing to worsen.
The war in Sudan, which has killed tens of thousands of people and displaced millions more, has spread to new areas in recent days, sparking fears of an even greater humanitarian catastrophe.
The paramilitary Rapid Support Forces (RSF), at war with the military since 2023, was preparing to launch an assault in Kordofan after capturing El-Fasher, the last army stronghold in the vast western Darfur region, reports AFP.
"Local sources report that at least 40 civilians were killed and dozens injured yesterday in an attack on a funeral gathering in El Obeid, the capital of North Kordofan State," the UN's OCHA agency said.
"Once again, OCHA calls for an immediate cessation of hostilities and for all parties to protect civilians and respect international humanitarian law."
The US is working with other nations to end the conflict in Sudan, the White House said on Tuesday.
The Rapid Support Forces' capture of Al-Fashir marked a milestone in the African country's civil war, giving the paramilitary group de facto control of more than a quarter of the territory, reports Reuters.