KABUL — A bitter power dispute that deeply divided Afghanistan's leadership and slowed the push for peace with the Taliban was resolved Sunday in a deal that could end months of political uncertainty.

President Ashraf Ghani and rival Abdullah Abdullah have signed a deal for the two men to share power. Ghani will remain president, but Abdullah's party will appoint half of the cabinet ministers. Abdullah will lead peace negotiations with the Taliban under the title of chairman of the High Council for National Reconciliation, according to a copy of the agreement seen by The Washington Post.

Months of bickering among the top leadership in Kabul sucked time and energy away from the push for peace. Even with the deal reached Sunday, it’s unclear whether the Afghan government will be able to make up for lost time.

Talks between the government and the Taliban originally slated for early March have not begun. In the meantime, violence across the country has spiked.

After a heinous attack on a maternity ward in Kabul last week, Ghani ordered his forces to relaunch offensive operations against the Taliban. The Taliban responded by calling the move a “declaration of war.”

The Taliban denied responsibility for the maternity ward attack, but Afghan officials insist the insurgent group was behind it. U.S. special representative Zalmay Khalilzad pushed back, saying the United States assessed that the Islamic State was to blame.

Khalilzad welcomed the deal between Ghani and Abdullah on Sunday. “It is high time to take seriously the resolve of the Afghan people, and the world, to finally see an end to this conflict,” he said on Twitter.

Secretary of State Mike Pompeo congratulated Ghani and Abdullah “for reaching an agreement on inclusive governance for Afghanistan,” spokeswoman Morgan Ortagus said. Pompeo also “reiterated that the priority for the United States remains a political settlement to end the conflict and welcomed the commitment by the two leaders to act immediately in support of prompt entry into intra-Afghan negotiations,” Ortagus added.

But there are few signs of progress on the ground. Taliban and Afghan government statements suggest violence from both sides has escalated since Ghani ordered the resumption of offensive operations. And the two sides have halted prisoner releases, which are a key precondition to talks.

With Abdullah’s appointment as chairman of the High Council for National Reconciliation, the deal reached Sunday also raises questions about who will have the ultimate authority to make decisions once talks with the Taliban begin. The United States began engaging with the Taliban in peace talks years ago, and some credit Khalilzad’s success to the degree of autonomy he was given by President Trump.

Also as part of the deal, Abdurrashid Dostum will be promoted to marshal and will gain a seat on the Afghan National Security Council. The controversial former vice president and warlord has been accused of beating and ordering the rape of a political rival while in office.

Ghani was declared the winner of a presidential election last year that was marred by reports of fraud and irregularities. Abdullah cited those reports when he rejected the results. In the weeks that followed, the two men held rival inaugurations and began taking steps to set up parallel governments.

The longtime rivals have entered into a power-sharing agreement once before. After a disputed election in 2014, an agreement brokered by then-Secretary of State John F. Kerry divided power between the two men, with Ghani as Afghanistan’s president and Abdullah as the country’s chief executive.

Both men blamed the agreement for government inaction as they campaigned ahead of the September election. They pledged never to share power again.

The deal announced Sunday follows months of intense U.S. pressure on the Afghan leaders. Pompeo traveled to Kabul amid the coronavirus pandemic to try to broker a deal. When he was unsuccessful, he threatened to cut $1 billion in aid to the country and further cuts if the deadlock persisted.

U.S. officials expressed concern that the divided government was hampering the coronavirus response. The country has confirmed relatively few cases, but testing remains extremely limited. A U.N. body has warned that Afghanistan could have one of the highest rates of infection in the world.

Pompeo tweeted Sunday that he welcomed the agreement, and he praised Ghani and Abdullah’s “commitment to act now for peace in Afghanistan.”

George reported from Islamabad, Pakistan.