Afghanistan's President Ashraf Ghani and his rival Abdullah Abdullah have signed a power-sharing deal, ending months of political uncertainty.
Mr Ghani will stay on as president while both men will choose an equal number of ministers.
Dr Abdullah will lead peace talks with the Taliban, should they get under way.
It is hoped the deal in the capital Kabul will help to maintain the balance of power that existed before last year's disputed presidential election.
Mr Ghani and Dr Abdullah - who both claimed victory in last September's election - last month held rival inauguration ceremonies.
The Afghan electoral commission says incumbent Ashraf Ghani narrowly won the vote, but Mr Abdullah has alleged the result is fraudulent.
The deal comes days after a militant attack on a maternity ward in the capital, Kabul, left 24 people dead. Mothers, newborn babies and nurses were among the victims.
No group has admitted carrying out the attack that shocked Afghanistan and the world.
What about the power-sharing deal?
Mr Ghani and Dr Abdullah - the old rivals who both held positions in the previous government - signed the agreement on Sunday.
Dr Abdullah, a former eye surgeon, wrote on Twitter after the ceremony that the agreement would help to form a "more inclusive, accountable and competent administration".
"We now need to come together as a nation, strive to seek solutions that are practical".
3/4 As we commit to form a more inclusive, accountable& competent administration, we are also reminded of the hard lessons to respect laws, fight the Coronavirus, fraud, injustice & corruption. We now need to come together as a nation, strive to seek solutions that are practical.— Dr. Abdullah Abdullah (@DrabdullahCE) May 17, 2020
President Ghani's spokesman Sediq Sediqqi said details about positions being held by members of Dr Abdullah's team would be revealed later.
The deal comes as Afghan authorities are hoping to enter peace talks with the Taliban to end years of violence.
Last month, the Taliban walked out of the talks, saying any face-to-face discussions with the Afghan government had proved "fruitless".
The talks reportedly broke down over a prisoner swap agreed earlier between the US and Taliban.
It was meant to be a step towards ending the war, but the Taliban say Afghan officials are trying to delay the release, while officials say the militants' demands are unreasonable.
Afghans, still reeling from last week's unthinkable attack on mothers and mourners, will welcome any shaft of light in this enveloping darkness.
Some hope this hard-fought deal is stronger than the 2014 accord that was clinched by decisive outside mediation by the US, but subsequently collapsed.
But this power-sharing pact involves the same individuals and interests, same personal and political clashes. And the same leaders and warlords of the past are still sitting in the front row of a tortuous history.
However, multiple crises are converging now: accelerating violence, a deadly virus, and sheer hunger.
Afghans will look to their leaders to prioritise a nation's yearning for peace ahead of their own personal political futures.
Moving toward talks with the Taliban is a process fraught with deepening doubt and danger.
This deal provides a political structure to build a way out of war. It has to hold fast lest it fall at the many hurdles to come.