Majzoub al-Khalifa, head of the government's negotiating team, and Minni Arcua Minnawi, a faction leader in the rebel Sudan Liberation Army (SLA), signed the deal in Nigeria's capital, Abuja, on Friday after intense talks under global pressure.
"We are reaffirming that the fighting ends now in Darfur ... We shall go ahead with peace and we shall be serious," Minnawi said at a signing ceremony at the Nigerian presidential complex.
Rebels took up arms in early 2003 in ethnically mixed Darfur over what they saw as neglect by the Arab-dominated central government.
Khartoum used Janjawid militias drawn from Arab tribes to crush the rebellion.
A campaign of arson, looting and rape has caused a humanitarian catastrophe in Darfur, where up to 300,000 people are said to have died from famine and fighting and two million have been displaced in the past three years.
The US labels the violence there genocide.
Mazjoud el-Khalifa (R) shakes
hands with Minni Minawi
The peace agreement, which covers security, wealth-sharing and power-sharing, is the result of two years of negotiations mediated by the African Union (AU).
It offers a referendum in the western Sudanese region and obliges the government to disarm and neutralise its Janjawid militia allies by mid-October.
It also provides for the rebel movements to be represented in the Sudanese government, and creates a fund for the reconstruction of Darfur.
Not all rally
Two other rebel factions refused to sign, complaining that the document fell short of their basic expectations. Diplomats said this could pose problems in the implementation phase.
Robert Zoellick, the US deputy secretary of state, said: "There will be tests because not all have shown courage and leadership today.
"We are reaffirming that the fighting ends now in Darfur ... We shall go ahead with peace and we shall be serious"
Minni Arcua Minnawi,
head of the SLA
"Those parties are bound by the ceasefire as all are."
The rebels who refused to sign also risk UN sanctions such as travel bans or a freeze on assets.
Three deadlines had passed without an agreement since Sunday because all the rebels had rejected the original AU draft.
To break the deadlock, an international team of diplomats led by Zoellick flew in over the last few days to extract a few extra concessions to the rebels from the government.
They obtained specific commitments to ensure the disarmament of the Janjawid and stronger provisions for the integration of rebel fighters into Sudanese security forces.
These helped persuade Minnawi to sign the deal, but they were not enough to convince Abdel Wahed Mohammed al-Nur, leader of a rival SLA faction, or the smaller Justice and Equality Movement (JEM).
Diplomats had said all along that it was most important to persuade Minnawi to sign as he controls more SLA fighters than Nur, while JEM is marginal in terms of forces on the ground.
"Unless the right spirit is there, the right attitude, this document will not be worth the paper it's written on. The spirit that led to the signing should continue to guide the implementation"
Nevertheless, Zoellick, Olusegun Obasanjo, the Nigerian president, and other leaders and diplomats tried until the last minute to coax Nur into signing, delaying the ceremony by several hours.
Their efforts failed, but a group of members of Nur's faction who were upset with him for refusing to sign burst into the signing ceremony as it was almost ending and said they wanted to be associated with the peace agreement.
The breakaway members of the Nur faction embraced Minnawi, their former rival, and Khalifa, the government chief, while elderly Darfur tribal leaders in traditional robes and turbans cheered and chanted.
In Washington, the White House said the US welcomed the agreement and urged the JEM and Nur's wing of the SLA to join the peace process.
"This agreement is a significant step in a long process to bring peace to all the people of Darfur," a statement said.
The deal came after a week of
It is uncertain whether the agreement will translate into peace in Darfur.
A ceasefire has been in place since April 2004 but the AU, which has 7,000 peacekeepers in Darfur, says all sides have continued fighting.
Obasanjo and all the other speakers at Friday's signing event emphasised that implementation of the deal was the key.
"Unless the right spirit is there, the right attitude, this document will not be worth the paper it's written on. The spirit that led to the signing should continue to guide the implementation," Obasanjo said in his opening speech.
Western governments have called for the AU mission in Darfur to be turned over to the UN but the government in Khartoum has said it would consider UN troops only after a peace agreement.
Zoellick later said Washington had asked Rwanda to send an extra 1,200 troops to Darfur immediately to strengthen the AU force until the arrival of UN troops, which he hoped would be in a few months.
Zoellick: Darfur is going to
remain a dangerous place
He also urged other countries to send aid to Darfur and said a donors' conference was planned soon in the Netherlands.
Zoellick said the violence would not end straight away.
"Is it going to change overnight? I wouldn't say that," he said. "Darfur is going to remain a dangerous place and it's going to remain a place of violence."
Jan Egeland, the UN humanitarian chief, said access for aid workers in Darfur is the worst it has been in two years.
"I first spoke to the UN Security Council on Darfur two years ago, calling it ethnic cleansing of the worst kind. Today, I could simply hit the rewind button on much of that earlier briefing," he wrote in an editorial on Friday.