Secretary of State John F. Kerry, right, and Afghan presidential candidate Ashraf Ghani meet at the U.S. Embassy in Kabul on Friday. (Jim Bourg/ASSOCIATED PRESS)

— Secretary of State John F. Kerry arrived in the Afghan capital Friday to push for a resolution to a weeks-long political crisis stemming from a presidential election marred by fraud. The dispute over a runoff last month has U.S. officials worried that Afghanistan, already roiled by a Taliban-led insurgency, could collapse before its first democratic transfer of power.

Kerry met with both candidates — former foreign minister Abdullah Abdullah and former World Bank executive Ashraf Ghani. He also met with Afghan President Hamid Karzai and U.N. officials.

The United States threatened to cut financial assistance to Afghanistan, which relies heavily on foreign aid to stay afloat, if the two sides do not resolve the impasse.

“We are at a very, very critical moment for Afghanistan,” Kerry said Friday in Kabul before meeting with the head of the U.N. mission in Afghanistan, Jan Kubis. “The future potential of a transition hangs in the balance.”

The election stalemate has gripped Afghanistan for nearly a month since Abdullah, who won the first round of voting in April but fell short of a majority, accused the country’s election commission of helping the government secure a victory for his opponent in the June 14 runoff.

Preliminary results released by the Independent Election Commission (IEC) on Tuesday showed Ghani in the lead with 56 percent, a stunning turnaround from the first round, in which he secured just 32 percent. In the first round April 5, Abdullah won 45 percent of the vote but now trails Ghani with just 43 percent.

IEC Chairman Ahmad Yusuf Nuristani acknowledged that the results had been marred by widespread vote-rigging and cautioned that the figures were not final tallies.

But the commission’s announcement had already incensed Abdullah and his supporters, who rallied around him at a massive demonstration in Kabul on Wednesday. They called the preliminary results a “coup” and urged Abdullah, a former top aide to legendary Afghan mujahideen commander Ahmed Shah Massoud, to declare a parallel government.

On Friday, Kerry said the results that had been announced “are neither authoritative nor final.”

“No one should be stating a victory at this point in time,” Kerry said before he and Abdullah met.

Abdullah, who is of mixed Pash­tun and Tajik heritage, draws much of his support from the minority ethnic Tajik communities in the northern and western parts of the country. Ghani, a former finance minister, is an ethnic Pashtun from the eastern province of Logar and is popular among Pashtun populations in the east and south. Pashtuns are Afghanistan’s largest ethnic group, accounting for about 42 percent of the population, and have traditionally ruled the country.

Talk of a parallel government has raised concerns among U.S. officials that the Afghan state could splinter along territorial or even ethnic lines, much as it did after the Soviet withdrawal from the country in 1989. Afghanistan descended into a hellish state of civil war, paving the way for the Taliban takeover of wide swaths of the country in 1996.

“Resorting to violence, as happened in our dark past, is not acceptable to Afghans nor to the world,” said Daoud Sultanzoy, a senior aide to Ghani. “We have to remove this psychology of war from our minds.”

In a briefing for reporters Friday, a senior U.S. official said the two sides agreed to broad points proposed by the United Nations. That general understanding would shape an extensive audit of suspect ballots, the official said.

The criteria for inspection would include districts with an unusually high turnout, where the number of votes reported includes round numbers, or where the number of female voters surpassed the number of male voters, the official said. These benchmarks would include 8,000 polling sites and roughly 3.5 million votes, or 43 percent of ballots cast.

The audit would take about two weeks, the administration official said. But neither side immediately signed off on the terms, Karzai’s office said Friday.

Aides to Abdullah said that they expected Kerry to be able to break the deadlock but that they also hoped the secretary of state would stand up against “any government that comes to power based on a fraudulent vote,” according to campaign spokesman Fazil Sangcharaki.

Sangcharaki said Abdullah’s team seeks an even more expansive review of the ballots, including the removal of the head of the Electoral Complaints Commission, a separate body tasked with fielding and following up on complaints from campaigns.

But the United States said Friday that it would use the threat of halting billions of dollars in annual aid to Afghanistan to prod the two sides to reach an agreement.

“The United States provides an extraordinary amount of assistance to Afghanistan,” the U.S. official said, adding that it amounted to $10 billion in the last fiscal year. “And whoever’s going to be governing the country, Afghanistan in the near future is going to be very dependent upon foreign assistance simply to fund the operations of its government.”

U.S. officials did not say how much aid they would cut if either side staged a power grab through violent or extra-constitutional force, but they emphasized that they were not coming down on the side of either candidate.

“We’re not here to put our thumb on the scale for any of these candidates,” the U.S. official said. “Both sides have expressed to the secretary that they want to get to an outcome that is credible, transparent and accepted.”

Sayed Salahuddin and Mohammad Sharif contributed to this report.