Liberia's President Charles Taylor has agreed to halt hostilities against rebel forces after a meeting with West African diplomats, paving the way for peace talks in Ghana to start in earnest.
The last-ditch push for a truce came as witnesses said rebel fighters had been driven back beyond Po River Bridge, some 12 km (eight miles) from the outskirts of the Liberian capital Monrovia.
The regional mediators, led by Ghanaian Foreign Minister Nana Akufo-Addo, said earlier the main rebel group, Liberians United for Reconciliation and Democracy (LURD), had promised to halt advances.
Peace talks meant to end a cycle of violence in Liberia have been stumbling along in Ghana for a week and mediators hope a ceasefire will allow serious work to begin.
But a rebel ultimatum demanding the resignation of Mr Taylor, who has been indicted for war crimes by a UN-backed court, expires today. Rebels at peace talks have not yet said what they will do, but will make a statement later.
LURD and another rebel group, known as Model, control around two-thirds of Liberia, a country of three million which was founded by freed American slaves as a haven of liberty but is now a byword for brutality in a region scarred by war.
The West African mediation team arrived as conditions in Monrovia grew more desperate after days of fighting, which saw rebels push to within five km (3 miles) of the city centre.
Liberians fear a repeat of the bloody fighting that left the city streets strewn with bodies in the 1990s during a brutal civil war. Refugees are huddled in schools and a sports stadium, with little food or water.
Medecins Sans Frontieres said possibly up to one million people were displaced in the city, with the situation especially difficult in northern districts. Many international aid workers have left.
Mr Taylor - a former warlord long accused of fuelling more than a decade of conflicts in West Africa - has been indicted by a UN-backed war crimes court in nearby Sierra Leone.
Senior West African officials have suggested Mr Taylor might be able to take refuge in another country if he left power, but the court's chief prosecutor said in a statement that there could be no escape for those indicted for war crimes.