A deal has been agreed to end weeks of violence in Sudan's South Kordofan state, where northern troops have been accused of ethnic cleansing.

Rebels who fought for the south during Sudan's long civil war are to be either integrated into the northern army or disarmed.

South Kordofan borders South Sudan, which is to become independent in July.

Some 70,000 people have fled their homes, with northern forces accusing of bombing Nuba-inhabited areas.

The agreement, mediated by the African Union, also covers the neighbouring Blue Nile state, which has been relatively peaceful.

The document stresses that any disarmament will be conducted without force.

An attempted disarmament seems to have been the trigger for the recent fierce fighting in South Kordofan, says a BBC reporter.

Anger at UN peace force

The framework agreement, signed in Ethiopia, stipulates that the northerners from South Kordofan and Blue Nile who fought for Sudan People's Liberation Movement (SPLM) rebels during the 21-year civil war will be integrated into the national army, or demobilised.

The SPLM now governs South Sudan.

The position of the northern states of South Kordofan and Blue Nile has been fragile ever since the end of the war in 2005, says the BBC's James Copnall in the capital, Khartoum.

The deal commits the Sudanese government and the northern wing of the SPLM to working out the terms for a ceasefire.

In addition, joint political and security committees are to be formed, our reporter says.

The recent clashes in South Kordofan pitted rebels from the Nuba Mountains against the north's armed forces, backed by Arab militias.

On Tuesday, representatives of the Nuba asked the mainly Egyptian UN peacekeepers in South Kordofan to leave the area.

Members of the Nuba Mountains-South Kordofan Women and Children Group demonstrated in front of the UN compound in Kauda village, accusing the UN force of siding with President Omar al-Bashir's National Congress Party (NCP) in the recent violence.

The SPLM-North, which enjoyed considerable support among the ethnic Nuba, says it was cheated of victory in recent South Kordofan governorship elections.

The fighting broke out when former SPLM fighters were ordered to disarm after Ahmed Haroun was declared the state's new governor.

Mr Haroun is wanted by the International Criminal Court for alleged crimes against humanity committed in Darfur.

During the weekend, he said the situation in South Kordofan was now safe and people had started to return to their homes.

But rights group Amnesty International said those who fled were being forced to go home despite continuing violence.

"Ordering families to return to a highly dangerous region where bombings continue is senseless," said Amnesty International UK's Tim Hancock.

There were reports of freshly laid landmines around the state capital, Kadugli, and concern that humanitarian agencies are being prevented from accessing many areas, he said in a statement.

- BBC