Sudan's southern former rebels have said they will rejoin a national unity government in an apparent end to the two-month political crisis.
Sudan's power-sharing government is to shift every three months from Khartoum to the southern town of Juba as part of the peace process, officials say.
The Sudan People's Liberation Movement (SPLM) withdrew from the government in October, jeopardising a peace deal.
The move is part of an agreement to improve relations between the predominantly Muslim north and the Christian and Animist south.
But the SPLM agreed to end its boycott after its leader Salva Kiir met Sudan's President Omar al-Bashir.
The ex-rebel Sudan People's Liberation Movement is to rejoin the government two months after pulling out.
They agreed funding for a census and a timetable to pull out troops either side of Sudan's north-south border.
More time has also been allocated to resolve outstanding issues.
They have also announced that the government will move to the southern capital, Juba, every three months.
A key sticking-point was the demarcation of the disputed oil-rich Abyei region.
However, an official said this would be a symbolic gesture at first "as the facilities in Juba are still run down".
The SPLM secretary general, Pagan Amum, said in Khartoum he was hopeful the peace agreement was back on track, and that the dispute over Abyei would be resolved soon.
There was no deal on the demarcation of the disputed oil-rich Abyei region after the two-hour meeting between the leaders.
All outstanding issues had been resolved apart from Abyei, he said.
The BBC's Amber Henshaw in Khartoum says many people were afraid Sudan would slide back into civil conflict, if the two sides did not resolve their differences.
"We are hopeful that by Saturday there may be a solution - we are hopeful," he added.
'Hopeful'
Leaders' meeting
The SPLM withdrew its ministers from the government, accusing President Bashir's National Congress Party of failing to implement the 2005 Comprehensive Peace Agreement (CPA) which ended the 21-year civil war.
The BBC's correspondent in Khartoum, Amber Henshaw, says many people feared Sudan was on the verge of sliding back into the brutal 20-year civil war that ended in 2005 and cost the lives of 1.5 million people.
SPLM Secretary-General Pagan Amum said most issues had been resolved.
But the SPLM agreed to end its boycott after its leader Salva Kiir met Sudanese President Omar al-Bashir.
SPLM DEMANDS Northern troops in south - resolvedSharing oil wealth - resolvedCensus ahead of 2011 referendum - resolvedStatus of Abyei - outstanding
They agreed the three-month rotation as well as funding for a census and a timetable to pull out troops either side of Sudan's north-south border.
"We have achieved a lot... We have resolved all the outstanding issues that caused the crisis, with the exception of Abyei," he said after Tuesday's late night meeting between Mr Kiir and Mr al-Bashir.
One official added the move to Juba would be a symbolic gesture at first "as the facilities [there] are still run down".
"The chairman of the SPLM will be issuing directives to the SPLM ministers to return to government," he added.
Mr Amum said that SPLM ministers would be instructed to return to government.
A timetable will now be worked out for the redeployment of northern troops from the south, especially from Unity and Upper Nile states.
There will be more transparency on issues of oil management and marketing plus funding to pave the way for a census in 2011, when the south could decide to split from the north, has also been assured.
However, the final border demarcation was not resolved - which means the division of oil wealth cannot be completed.
It is the status of the disputed oil-rich region of Abyei - that currently lies in the north - that is the problem.
Mr Amum he did not see this as a major stumbling block.
"The issue of Abyei is being discussed by the presidency - we're hopeful that by Saturday there may be able to reach a solution."
The unity government will also set up a development commission to speed up road links between the more developed north and the south, which has little infrastructure after the long war.
The unity government will also set up a development commission to speed up road links between the more developed north and the south, which has little infrastructure after the long war.
Under the peace deal, the SPLM leader is also national vice-president.
Under the peace deal, the SPLM leader is also national vice-president.
Some 1.5 million people died in Sudan's conflict - Africa's longest civil war - which pitted the mainly Muslim north against the Animist and Christian south.
There are currently 10,000 UN peacekeepers in South Sudan.
There are currently 10,000 UN peacekeepers in South Sudan.