The term of Afghanistan’s president has been extended by the supreme court until delayed elections take place, an official said Sunday. The decision resolves the question of what would happen after Ashraf Ghani’s term expires on May 22.

Presidential elections were initially slated for April 20, but Afghan poll officials were unprepared for a new nationwide vote so soon after October parliamentary elections.

With some final results from that election still pending, the presidential poll was delayed until July 20, then pushed back again until September 28.

Ariana News published a statement from the court saying it “has extended the service term of President Ghani until the re-election of a new president.”

It added, “The supreme court understands the financial, security and logistical challenges faced by the election commission.”

While the court did not make the statement public, Faraidoon Khwazoon, the deputy spokesman to Afghan chief executive Abdullah Abdullah, confirmed the document to AFP, noting that Abdullah’s term had also been extended.

“Yes, the supreme court has made its decision, based on the constitution, on the extension of the service term of the president,” Khwazoon said, adding the extension would last “until the re-election of the new president.”

Ghani’s office could not immediately be reached for comment.

The delayed elections come as the United States tries to negotiate a peace agreement with the Taliban, and some had speculated that the polls were being deliberately stalled to create more space for those talks.

Opposition politicians and presidential contenders had called for an interim government to fill the gap between Ghani’s mandate expiring and the presidential elections.

The supreme court said it was asking “presidential candidates to respect the delay in the presidential elections.”

Ghani was elected in 2014 in a closely contested poll that was mired by allegations of fraud and that saw him lead a power-sharing government.

– with reporting by AFP