KABUL -- Afghanistan's major presidential candidates are tentatively exploring alliances, said several campaign aides and Western diplomats, positioning themselves for leading roles in the next government amid concerns over the turmoil wrought by the protracted contest.

Opposition candidate Abdullah Abdullah, left, and Afghan President Hamid Karzai.

The team of President Hamid Karzai, who has nearly a 27-point lead over chief rival Abdullah Abdullah, has been in talks with other candidates. Several candidates have accused the incumbent, Mr. Karzai, of trying to steal the election with widespread ballot-stuffing and voter intimidation. Some have pledged not to recognize his potential victory. But an increasingly potent Taliban insurgency, and the prospect of militants continuing to exploit political uncertainty, has driven candidates to look for ways to work together.

On Wednesday, the Afghan election body announced the full results, declaring that Mr. Karzai won 55% of the vote. The turnout was 39%, far below the 70% in the most recent presidential elections of 2004. With a number of fraudulent votes slated for disqualification, the real turnout could prove even lower. The low turnout is a blow to the credibility of the Afghan government and its Western backers, who touted the elections as a sign of progress.

The results will be scrutinized for fraud before an official winner is declared -- a process that could last well into October.

Dr. Abdullah's campaign spokesman, Fazel Sangcharaki, said that they would refuse to recognize the result. "We will wait until the [Electoral Complaints Commission] finishes its investigation before we decide our course of action," he said. "We will use every constitutionally legal avenue afforded to us to protest these results."

An Afghan traffic police officer manages a crossing under Afghanistan president Hamid Karzai's election poster, in Kabul, Afghanistan. Associated Press

Aides to Mr. Karzai said they won't declare victory until the results are vetted and certified. They said they didn't expect enough votes to be disqualified to force a runoff.

"Something very drastic would have to happen for there to be a second round," said Karzai campaign spokesman Wahid Omar. "Based on the numbers, it seems very likely that we will win in one round."

Despite the uncertainty surrounding the results, Dr. Abdullah's team has begun to reach out to the Karzai camp, according to an Abdullah campaign adviser. If Mr. Karzai is willing to enter into a "serious and substantial" power-sharing agreement, the adviser said, Dr. Abullah would be willing to take part. The two sides are speaking through third parties, although the adviser declined to identify the parties. As the former foreign minister, Dr. Abdullah has worked with the Karzai government before.

At the same time, Mr. Karzai's team is reaching out to Ashraf Ghani, a former finance minister and presidential candidate in fourth place. Mr. Ghani visited the presidential palace Wednesday night, according to officials from both sides, to discuss what role Mr. Ghani might play in a new government. Officials didn't outline any deal, and details of the meeting weren't available. Mr. Ghani's campaign declined to comment.

Mr. Ghani, who is popular in some Western circles, is seen as a technocrat with a clean past and detailed proposals for reforming the Afghan government.

A second round would take place if Mr. Karzai slips below 50% of the vote. Afghan elections officials have already ordered ballots for the next round, according to Daoud Ali Najafi, the country's chief electoral officer.

Facing a possible runoff, Mr. Karzai has been seeking allies who could help break the stalemate as well as scrub the taint from the troubled election, some Afghan and Western officials say.

"We welcome any opportunity to work with Dr. Abdullah or Dr. Ghani," said Karzai campaign spokesman, Mr. Omar. In particular, Karzai officials say they hope that a deal with Dr. Ghani could bring Mr. Karzai more votes in case there is a second round. "He is a Pashtun and he is popular with the Americans," said a different campaign official. "He would be an asset to the new government."

Officials from all sides, however, caution that talks are all preliminary and could quickly fall apart. "We are at the beginning," said the Abdullah adviser. "There are so many 'ifs.' We're going to need some sort of guarantee." The adviser wouldn't specify what such a guarantee would be.

It isn't clear what any of the presidential candidates would gain from such political alliances -- or their potential effect on a possible runoff vote. Mr. Karzai, as the front-runner in the vote tally, has the most to gain from political allies, but even marshalling the support of another candidate, such as Dr. Ghani, wouldn't guarantee him a decisive portion of votes in a runoff.

The U.S. government and its allies have watched nervously as Mr. Karzai has widened his lead in the balloting results, even as he has drawn criticism for allegedly rigging the election -- a charge his camp denies.

An Afghan man sits beneath posters for presidential and provincial-council candidates in Kabul on Wednesday. Allegations of fraud in the August ballot may delay the official declaration of the next president until October. Reuters

A strong, democratically elected government is the linchpin of U.S. plans to help stabilize Afghanistan, as more troops and aid arrive. Nevertheless, Mr. Karzai's popular standing appears to be eroding as the election dispute drags on.

The Taliban insurgency and imminent winter weather also have made the prospect of a runoff -- or an entirely new election -- less desirable to many involved in the election process. As a result, some who have staunchly backed a full investigation into ballot fraud are now watching with guarded optimism as rival candidates explore power-sharing pacts.

"Ideally an election should be resolved by the voters casting their votes and those votes being honestly tabulated and one person emerging as a winner. But there are complications in Afghanistan," said a Western diplomat. "If there's some kind of deal that promotes domestic peace, that's a reasonable alternative. Not the ideal one, but a reasonable one."

Western diplomats in Kabul said the international community -- the U.S. and its allies -- isn't taking an active role. "The U.S. is not pushing for any deal. We support the electoral process, and we will continue to do so," said Caitlin Hayden, a spokeswoman for the U.S. Embassy in Kabul.

There are concerns, expressed by Abdullah supporters and Western diplomats, that the moves on Mr. Karzai's part are a tactical effort to appear magnanimous as he marginalizes his top rivals.

Write to Matthew Rosenberg at matthew.rosenberg@wsj.com