WASHINGTON (AP) — The Obama administration applauded the power-sharing deal signed Sunday by Afghanistan’s two presidential candidates.

The agreement resolved a drawn-out dispute that threatened to plunge Afghanistan into political turmoil while complicating the withdrawal of U.S. and foreign troops.

A White House statement said the pact will help bring closure to Afghanistan’s political crisis and restore “confidence in the way forward,” and that the U.S. was ready to work with the new Afghan government to ensure success.

The deal is a victory for Secretary of State John Kerry, who got the candidates to agree in principle to share power during a July visit to Afghanistan.

Ashraf Ghani Ahmadzai will become president and Abdullah Abdullah will hold the newly created post of chief executive.

Kerry hailed the resolution as “a moment of extraordinary statesmanship.”

He said Afghanistan “has an enormous opportunity to grow stronger from this recent moment of testing.”

Copyright 2014 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.