Imran Khan addresses his supportersAthit Perawongmetha / Reuters

This article was updated on July 28 at 9:41 p.m.

On July 25, Pakistanis went to the polls to elect a new government in what would be only the second transition of power from one civilian government to another in the country's seven-decade history. That might be cause for celebration, except that the vote was hardly a peaceful or squeaky-clean affair. Despite the 371,000 soldiers stationed at polling places around the country—five times the number out in force during the previous vote—bloodshed still marred the day. The worst bombing took place in the city of Quetta, where a suicide attack killed 31. Moreover, accusations of vote rigging in favor of the winning party, the former cricketeer and man-about-town Imran Khan’s PTI, cast doubt on the legitimacy of the outcome. Should PTI’s victory be understood as further proof that this volatile republic, traumatized by decades of war and impoverished by a self-dealing elite, is doomed? Or is it an indication that this youthful country, with a median age of under 24, is ripe for a post-ethnic politics of reform?

In the short time since the party's founding, the PTI and Khan have been accused of many things. Whereas some observers, and at times Khan himself, have characterized the movement as a modernizing—even liberalizing—anti-corruption force, others have pointed out Khan's appeals to Islamism and purported ties to the military, which has ruled the country for much of its history. During the latest vote, according to C. Christine Fair writing for Foreign Affairs, “the army was hell-bent upon securing Khan’s victory and even encouraged political parties with overt ties to terrorist groups to field several hundred candidates, alongside some 1,500 candidates tied to Pakistan’s right-wing Islamist parties.”

There is little doubt that Pakistan’s powerful military was involved in securing Khan’s victory, and of course his ties to Islamist parties are deeply worrisome. However, his party's popularity portends at least one positive development for Pakistan: the decline of political parties rooted in ethnicity. To understand how, some history is helpful.

In previous decades, when Pakistan had a civilian government, that government would most likely be led by one of two parties: the Pakistan Peoples Party (PPP) or the Pakistan Muslim League (PML). These parties did, of course, have official ideological platforms. The PPP was founded as a socialist party. And the various versions of the PML that have contested elections characterized themselves as center-right parties. Yet the ostensible ideologies of those two parties have never been as important as their ethnic affiliations. As a general rule, the PML would win with Punjabi voters in the country’s most populous province, Punjab, and the PPP would take Sindh, a province with a distinctive ethnoreligious identity. Smaller parties could appeal to ethnic groups in Baluchistan, in the teeming city of Karachi, and so on.

There is nothing intrinsically objectionable about ethnic politics, and parties that defend the interests of distinct cultural communities play a valuable role in many flourishing democracies. But in Pakistan, the main parties’ reliance on ethnic ties has badly undermined state-building efforts. Before this decade, no democratically elected leader had every completed a full term; instead, they were generally dismissed or overthrown by the military, judiciary, or both. There was no expectation, therefore, that rule by one party could lead peacefully to rule by another, or that the ruling party would have any cause to appeal to voters outside its ethnic base during its (usually brief) stint in power. As Adam Prezworski has written, democracy can only persist in situations where “political forces that lose in contestation comply with the outcomes and continue to participate rather than subvert democratic institutions.” And, since Pakistani voters on the losing side had little reason to comply, politics became a fraught affair. Elections frequently ended in tensions or violence between partisans of the main parties—that is, in ethnic violence, even if it was described otherwise by officials desperate to keep it from spiraling out of control. It was then that the military would step in.

In the elections of 1970, for example, the PPP won the majority of the vote in West Pakistan, while the Awami League won the Bengali vote in the East, ultimately leading to a bloody war of secession. In 1977, the sitting PPP government won elections, but the opposition’s refusal to cede the vote led to protests that ended with a coup by Zia ul-Haq. Even the coup by Pervez Musharraf, which is often seen as a response to the embarrassment the Pakistani military suffered at Kargil at the hands of India, followed a decade of democratic breakdown. Ferocious conflict between the PPP and PML, in which each forced exchange of power led to more ethnic tension, more protests surrounding a delayed census, and more radicalization among smaller ethnic parties, particularly the MQM in the city of Karachi, paved the way for military rule.

As power-hungry as the military is seen to be today—and as damaging as its frequent takeovers have been—it makes sense, then, to view its forays into governance through the framework that the political scientist Barbara Geddes set out in 1999: It is neither the job nor the goal of militaries to govern countries forever. They become more likely to step in when they see threats to stability, national integrity, and law and order that could undermine their ultimate objectives: the “maintenance of hierarchy, discipline, and cohesiveness within the military; autonomy from civilian intervention; and budgets sufficient to attract high- quality recruits and buy state-of-the-art weapons.” Moreover, it is worth keeping in mind that, painted as efforts to restore order, coups in Pakistan have generally been accepted by at least some portion of the public and legitimated after the fact through the courts.

That brings us to Imran Khan’s PTI. Strikingly, the party does not have an ethnic base at its core, which is why, through careful tailoring of messages, the party has managed to appeal in previous electoral attempts to both urbanites who were sick of the corruption and inefficiency plaguing the two main parties and, at the same time, to Islamists in the northern areas. As of the latest reports (the full official results have not been released), the PTI has secured at least 115 seats in the National Assembly, compared to around 42 for the PPP and 65 for the PML. That is a stunning result in and of itself—it would be as if a charismatic American third-party candidate had soared to victory by appealing to cosmopolitan socialists in the nation’s gentrified urban neighborhoods and socially conservative nationalists in the heart of Appalachia.

An electoral map compiled by Al Jazeera reveals something even more astounding: The PTI won big in Khyber Paktunkhwa and the Tribal Areas; made a strong showing in Balochistan, where parties representing ethnic Baluch preferences have historically been strong; won 122 seats in the provincial assembly in PML’s stronghold in Punjab (the PML squeezed out 127 which, for it, is a very poor showing); and even made a dent in Sindh, where the PPP has typically dominated the rural regions and the MQM has taken the city of Karachi. Most shockingly of all, PTI won Karachi outright, after an incredible three decades of dominance by the MQM, a party created to further the interests of the Mohajir ethnic group, the name given to the migrants who left India for Pakistan during partition and their descendants.

The PPP and, especially, the PML have good reason to protest the result, as the election was plagued by irregularities. And there is no gainsaying that PTI’s connections to Islamist groups and to the military are cause for concern. A militantly Islamist Pakistan could wreak havoc in the region and the wider world, and one hopes that Khan will prove more moderate and pragmatic in office than his rhetoric on the campaign trail would suggest—rhetoric that arguably served the purpose of allowing PTI to outflank more extreme religious parties, which saw their support plummet. Nevertheless, it is notable that, for the first time in its history, Pakistan could well be ruled by a party not beholden to any one ethnic group. Though that won’t solve the country’s problems, it could chip away at the big problem that has allowed the military to step in, again and again: the deadly persistence of zero-sum ethnic politics.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.