The government of Sudan and a southern-based rebel movement have signed an agreement on power-sharing as they move to end Africa's longest civil war.

The documents were signed by representatives of the Sudan government and the Sudanese People's Liberation Army amid whoops and cheers from hundreds of Sudanese refugees who had come to witness the historic event.

Mediators say the deal signed Wednesday clears the way for final negotiations on a permanent cease-fire and security guarantees that they hope to conclude by mid-July.

The Kenyan foreign minister, Kalonzo Musyoka, said the agreement could also speed up a settlement of the conflict in Sudan's western Darfur region, where one million people have fled their homes as black African rebels fight government-backed Arab militiamen.

"We trust that this significant achievement in the peace effort will lead to a just and lasting political settlement not only for the south, but also for the entire country, including the western region of Darfur," said Mr. Musyoka.

The chief negotiator for the SPLA rebels, John Garang, said he was looking forward to what he called a "great and bright future" in Sudan. "We in the SPLA are only fulfilling a promise that we have made, and a cause we have professed, which is creating a new Sudan, united in honor, on a new basis of justice for the good of its entire people irrespective of their ethnic origin, irrespective of their region, irrespective of their religion, culture or gender."

And Sudan's vice president, Ali Osman Taha, indicated the government intends to eliminate discrimination that has divided the country along ethnic and religious lines. Mr. Taha said that by ending the war in the south the government is committed to not differentiating either politically or socially among the Sudanese people.

The fighting in southern Sudan began in 1983 when the predominately Christian and Animist population took up arms against the Muslim Arab government of Khartoum.

The war has claimed an estimated two million lives, most of them civilians who died of disease or famine.