As ballots were tallied Sunday from Afghanistan’s presidential election, many voters hoped that the country was moving into a new era marked by its first democratic handover of power. But early returns in Kabul pointed to the enduring power of ethnic politics.

The presidential candidates had tried to market themselves as post-ethnic leaders, promoting economic and political reform rather than the kind of sectarianism that fed the civil war in the 1990s. An electoral result that breaks down along ethnic lines could complicate the formation of the next government, requiring negotiations and compromises to create a broad-based coalition.

Saturday’s election drew a surprisingly large turnout despite threats from the Taliban to disrupt the balloting. At least 23 people were killed on election day and the prior day, mostly soldiers and police officers, the government announced.

Three more people were killed Sunday, including at least one election worker, when a government vehicle struck a roadside bomb in northern Kunduz province, according to Afghan officials.

But there were no large-scale attacks in Kabul, and the death toll was lower than many had expected.

As votes were counted, the country’s electoral complaints commission started processing about 1,000 formal allegations of fraud. The last presidential election, in 2009, was plagued by irregularities, and many Afghans pointed fingers at election staffers thought to be acting on the basis of tribal or ethnic loyalties.

Afghans have keen memories of the brutal war that raged among ethnically based militias, killing tens of thousands of people and destroying large parts of the capital.

Eighteen years after it ended, tensions among those groups have diminished. Saturday’s election was celebrated in many quarters as a moment of national unity and collective opposition to the Taliban. But Kabul is still divided into neighborhoods reflecting the country’s largest ethnic groups.

In several predominantly Tajik neighborhoods, for example, the ethnic Tajik presidential candidate, Abdullah Abdullah, was the clear winner based on preliminary results. He received about 75 percent of the vote, out of a total of about 3,000 ballots cast at four polling stations. Ashraf Ghani, who is a Pashtun, thought to be Afghanistan’s largest ethnic group, was the second-highest vote-getter, receiving about 18 percent.

In several Pashtun neighborhoods, the results were reversed, with Ghani winning about three-quarters of the vote.

In ethnic Hazara neighborhoods, Abdullah was the overwhelming winner. His vice-
presidential pick, Mohammad Mohaqiq, is a Hazara warlord.

“Our whole people voted for Abdullah because of Mohaqiq,” said Mahram Ali, 48, a Hazara. “We want a change in leadership from Pashtun to Tajik — and afterwards, our turn will arrive.

The lopsided results are based on a fraction of preliminary tallies posted outside polling centers, but they paint a picture of a trend expected to emerge across the country as votes are counted over the coming weeks.

Patronage and presidency

The country’s election commission estimates that about 7 million votes were cast. Kabul is home to about one-sixth of Afghanistan’s population but could represent a bigger share of the electorate because of low turnout in rural areas plagued by Taliban attacks.

A candidate has to win more than 50 percent of the vote in the first round to avoid a runoff, which would be held later this spring or in the summer.

“Pashtuns vote for Pashtuns,” said Nangullah, a resident of Kabul’s Arzan Qemat neighborhood, where about 90 percent of the community is Pashtun and where Ghani won an overwhelming number of the votes.

In the 2009 presidential election, ethnicity played an important role, with incumbent Hamid Karzai taking the vast majority of the Pashtun vote and Abdullah winning the Tajik community’s support. Abdullah later dropped out of the runoff. Karzai was not eligible to run for a third term.

Although Karzai’s presidency was criticized for corruption and poor relations with Washington, he proved adept at building a coalition with strongmen from across Afghanistan’s ethnic spectrum. For more than a decade, that approach kept ethnic flare-ups to a minimum. In universities and in some ministries, an ethnically diverse meritocracy appeared to take form.

Still, strong patronage networks exist within each group, and top officials in both the private and the public sector often recruit from their own ethnicities.

The next president also is likely to have to form a coalition spanning Afghanistan’s major ethnic groups.

Cross-ethnic appeals

During this election, the candidates worked harder to win support from outside their ethnic groups. They recruited vice-
presidential candidates of other backgrounds who would expand their appeal. And they traveled well beyond their traditional spheres of influence.

Abdullah flew to Kandahar province, the Pashtun heartland, and said he had spoken to voters there “as an Afghan,” rather than as a member of a different ethnic group.

Ghani boasted of “a political alliance that is widely based.” That alliance included the Uzbek warlord Abdurrashid Dostum, who reportedly brought the ticket thousands of votes from that ethnic group, particularly in northern Afghanistan.

Zalmay Rassoul, another leading candidate, made a similar post-ethnic pitch, but at polling stations visited Sunday by Washington Post reporters, he had won only a fraction of the vote.

The cross-ethnic appeals resonated with some voters, particularly a class of young, educated Afghans in Kabul, who said they were more interested in the candidates’ platforms than in their ethnicities.

Some voters said the qualities they look for in a president have broadened to include having an effective economic plan and an ability to work with the international community. For them, ethnicity is just one box on the checklist.

“There were various factors that prompted me to vote for him, ethnicity being one of them,” said Mohammad Modabir, a 28-year-old Tajik who voted for Abdullah.

For some Pashtuns, who speak Pashto as a first language, Ghani stood out because he was the only front-runner who addressed them fluently in their native tongue.

“There’s no way he would have received so many votes if he was Tajik,” said Ashokullah Hotak, a Pashto-speaking carpet seller in the Pashtun neighborhood of ­Utkhel.

Mohammad Sharif, Joshua Partlow and Sayed Salahuddin contributed to this report.