Rival Afghan factions have struck a breakthrough deal on a UN blueprint for a new broad-based interim government for Afghanistan but are still haggling over cabinet posts.
"I'm hoping we'll get it done today or tomorrow morning", said royalist delegate Mohammad Ishaq Nadiri, a professor of economics at New York University.
After a week of gruelling talks in a top-security hotel outside Bonn, and with many delegates observing the daylight Ramadan fast, the four Afghan groups finally backed an accord to establish a power-sharing government.
"There was a general feeling of jubilation in the room when we finished. There were tears in some eyes, including my own", UN spokesman Ahmad Fawzi said.
The accord asked the UN Security Council to consider mandating an international force to Afghanistan to maintain security for the Afghan capital Kabul and surrounding areas.
The agreed UN text is an outline for an interim government for about six months until a Loya Jirga, or traditional assembly, is held.
The text calls for Afghanistan's 87-year-old former king Zahir Shah to participate in the Loya Jirga rather than play a symbolic role in opening it, as the original draft had proposed.
The Loya Jirga will elect a transitional authority to govern for about 18 months until a constitution is drawn up and a permanent government elected. The text states that a free vote must be held not less than two years after the Loya Jirga.
But for now, the issue of who will fill which cabinet post is crucial, as each of Afghanistan's main tribes and factions will have to be convinced that it is properly represented.