Kabul: Afghanistan's rival leaders were each sworn in as president in separate ceremonies on Monday, throwing plans for negotiations with the Taliban into chaos and creating a dilemma for the United States as it figures out how to move its peace deal with the Taliban forward.

The US-Taliban deal signed just over a week ago was touted as Washington's effort to end 18 years of war in Afghanistan and was seen by many Afghans as the best opportunity yet for bringing an end to relentless wars.

But President Ashraf Ghani, who was declared the winner of last September's election, and his rival Abdullah Abdullah, who charged fraud in the vote along with the elections complaints commission, have refused to settle their differences.

The two ceremonies were held at the same time, Ghani's in the presidential palace and Abdullah's next door in the Sapedar Palace, both packed with each rival's supporters.

In a sign of international support for Ghani, his ceremony — aired on state TV — was attended by Washington's peace envoy Zalmay Khalilzad, General Austin S Miller, the head of US forces in Afghanistan, as well as a number of foreign dignitaries including the US Embassy's charge d'affaires and Tadamichi Yamamoto, the UN Secretary General's personal representative to Afghanistan.

At Abdullah's inauguration, aired on private Tolo TV, among those present were so called "jihadi' commanders, who were among those who allied with the US-led coalition to topple the Taliban in 2001.

Those commanders also participated in the brutal civil war of the 1990s, raising fears that the divisions among Afghan leaders could lead to violence.

When Washington and the Taliban insurgents signed their accord on February 29, the next crucial step was that Afghans would sit down and negotiate a road map for their country's future.

They are looking to hammer out such thorny issues as women's rights, free speech and the fate of tens of thousands of armed men on both sides of the 18-year war. Those negotiations were set to be held Tuesday in Oslo.

But the dispute between the top two candidates in last year's presidential election over who actually won means the Afghan government side appears unable to present a united front.

The US has said its troop withdrawal from Afghanistan will be linked to the Taliban keeping their counter-terrorism promises, but not to the success of talks between the Taliban and the Afghan government.

Afghanistan's election commission has declared incumbent President Ashraf Ghani as the winner of September's vote. His former partner in a unity government, chief executive Abdullah, as well as the election complaints commission say the results are fraught with irregularities. As a result, both Ghani and Abdullah declared themselves winners.

The two candidates are also backed by warlords who have a stake in who becomes president, complicating negotiations to break the stalemate being conducted Khalilzad.

The dueling inaugurations took place despite last-minute shuttle diplomacy by Khalilzad, who reportedly went back and forth between the two Afghan rivals into the early hours Monday.

A senior member of Abdullah's team, Basir Salangi, told local Afghan channel Tolo TV that the US peace envoy has asked both sides to delay their inaugurations for three days to sort out the stalemate. Abdullah reportedly said he was ready, but would go ahead with his ceremony Monday if Ghani refused to postpone.

Taliban spokesman Zabihullah Mujahed, in response to questions from The Associated Press, said late Sunday that the Taliban were still committed to the deal, but said the dueling presidential inaugurations "are not good for the Afghan nation".

As well as competing candidates, Khalilzad still has to get some agreement on a prisoner release, which was supposed to be settled before the intra-Afghan negotiations could begin.

The peace deal signed by the US and Taliban said 5,000 Taliban prisoners and up to 1,000 captives from the government side would be freed as a goodwill gesture ahead of the talks.

Ghani had previously said he won't release the Taliban prisoners, even as US Secretary of State Mike Pompeo called on all sides to stop posturing and free their prisoners, some of whom have already served their sentences. Pompeo called on all sides get on with talks about the country's future.

The Taliban spokesman told AP that the group wants their prisoners released and were ready to free the captives they're holding. Mujahed said they did not want to see a delay but reiterated that if it occurred "we remain committed to the agreement".

In a tweet, Afghanistan's former deputy foreign minister, Jawed Luddin, thanked Washington for trying to sort out Afghanistan's political turmoil while calling the squabbling "a mess".

"Thank you, USA, for trying to sort out our political crisis -- yet again. We know you must be sick of it -- as are we Afghans," Luddin said.

You and us both had a hand in bringing about the mess that is today's Afghan politics. But I wish we Afghans felt half as responsible for the mess as you do," he added.

The deal signed by the US would allow Washington to end its involvement in Afghanistan and bring home US troops over a period of 18 months.