Imran Khan addresses supporters at a rallyAthit Perawongmetha / Reuters

ISLAMABAD, Pakistan—At long last, Imran Khan is victorious. After winning the highest number of seats in parliament in this week’s election, the former cricket legend and philanthropist is now set to form a national government and possibly rule two of Pakistan’s four provinces, making him the country’s most powerful civilian leader in decades. It’s a remarkable reversal of fortunes for Khan, who for decades was mocked by his opponents as a naïve, inexperienced celebrity keen to perpetuate his own fame. Khan, however, remained determined. “I always fight till the last ball,” he told me a few years ago.

Khan won a special place in Pakistani hearts in 1992, when he led the national cricket team to victory at the World Cup. In a country where passions for cricket can reach near-religious fervor, the cricket team is seen as a metaphor for the government: full of rarely realized potential, but thwarted by poor leadership and appalling greed. After the World Cup, and Khan’s retirement, there were lurid allegations of ball-tampering and match-fixing. The sporting heroes were reduced to the status of grasping politicians. Khan’s fans wistfully recalled the glory days of his captaincy; now they hope he can do the same for the country.

Leading a nation, of course, is nothing like captaining a cricket team. Pakistan is a very difficult country to run, beset by numerous internal divisions—some of which could deepen after this election. During the campaign season, the party of former Prime Minister Nawaz Sharif, who was disqualified from office last year and is now behind bars on corruption charges, said that it had been denied a “level playing field.” Reports proliferated that the country’s powerful military—in its zeal to punish Sharif for defying its authority—had intimidated, harassed, and coerced candidates from his party into switching sides, stopped them from campaigning freely, and denied them media coverage. “This was not an election, it was a selection,” Mushahid Hussain, a senator from Sharif’s Pakistan Muslim League-N (PML-N), said at a press conference. “It was the dirtiest election in Pakistan’s history.” Similar claims of rigged elections have been made by other political parties, including the Pakistan Peoples Party (PPP), and observers like the Human Rights Commission of Pakistan.

Khan views himself as a classic populist, a politician who opposes a corrupt, morally inferior class of elites. His rhetoric is studded with broad appeals to religious and nationalist sentiment. Like other populists, Khan has offered implausible promises to sweep away entrenched problems: “I will end big corruption in 90 days,” he once vowed at a political rally. He cast himself as the only plausible alternative to an inept, venal, distant political elite. His party’s message: You’ve tried the others—why not give him a try this time? This pitch, whose appeal was once limited to the urban middle classes and elites, has now drawn support from a remarkably diverse array of people, from film and pop stars to religious hard-liners, wealthy businessmen to struggling workers, and large landowners to beleaguered farmers. But many doubt whether he can unite such an unwieldy coalition of supporters while delivering on his ambitious political agenda, and avoid veering into the outright demagoguery he occasionally indulged in on the campaign trail.

Khan, unsurprisingly, bristles at claims that he is the military’s preferred choice. His party, however, has done little to discourage the impression. Ahead of the elections, the Pakistan Tehreek-e-Insaf (or “Movement for Justice”) welcomed prominent alums from military governments past—people like Omar Ayub Khan, the grandson of the former military ruler General Ayub Khan, and Khusro Bakhtiar, a former minister under Pervez Musharraf—who had suddenly discovered Khan’s political virtues. These so-called electables carry clout in their own constituencies but they needed a strong party to transport their parliamentary ambitions. One former member of Khan’s party, Javed Hashmi, has claimed that the military had been engineering defections from other parties for years.

In recent years, Khan and the army have drawn closer together. They both wanted Sharif out of office. They both see the PPP and PML-N as corrupt dynasties that are holding the country back. The army likes Khan’s displays of nationalism. But there are key differences, too. In the past, Khan was a fierce critic of the army’s intrusions into politics, its alliance with the United States in the War on Terror, and the military operations that took place along the border with Afghanistan. In a speech Thursday, Khan said he wants to have peace and boost trade with India, open borders with Afghanistan, and enjoy a “mutually beneficial” relationship with the U.S.—all initiatives that may irk the Pakistani military.

As prime minister, Khan will want to assert himself as the most powerful leader in the country. That role has traditionally belonged to the army chief, who, even during times of civilian rule, has been able to exercise influence from behind a thin veil. No longer tempted by direct military coups, the military leaves the day-to-day running of the country to the civilians while retaining the levers of power that matter most to them: foreign policy, defense policy and elements of the economy. They won’t be eager to cede those prerogatives to Khan.

Meanwhile, Khan’s critics also fear that he’s on a path to becoming the world’s latest strongman ruler. During the election campaign, Khan issued unedifying attacks on his opponents, claiming they were working at the behest of Pakistan’s enemies. He compared the voters who supported them to donkeys (which led some of his supporters to beat an actual donkey to death). He lashed out against the sections of the press he perceives as hostile to him. He has also been criticized for supporting Pakistan’s controversial blasphemy law, which makes any “imputation, insinuation or innuendo” against the Prophet Muhammad punishable by death. Critics say Khan, who previously called for the law be amended to stop its misuse, changed his position in an effort to woo Pakistan’s right-wing religious community.

But Khan is not the crude, two-dimensional demagogue some have suggested. When I covered him as a journalist, I saw him speak out against enforced disappearances, attacks on freedom of expression and the press, extrajudicial executions, drone strikes that kill innocents, and the persecution of religious minorities. Off the campaign trail, Khan and his party have vowed to combat climate change. He led a desperately needed anti-polio drive in a country where the disease still stalks children. The Taliban have attacked anti-polio workers, accusing them of trying to sterilize people. Unlike Donald Trump, Khan has been a successful philanthropist, building two cancer hospitals that treat the poor for free and a university near his hometown.

In his speech on Thursday, Khan pledged not to seek political revenge on his opponents—a reflex common among demagogues. Instead of scapegoating minorities, as demagogues often do, he said he will protect their rights. He said he wants to unite the country and vowed to strengthen its institutions. He pledged to rid the country of corruption, holding himself and his cabinet accountable first, to educate the more than 25 million children out of school, and to build a future for the country’s overwhelmingly young population.

It’s a massive undertaking, raising expectations that would overwhelm even the most capable and efficient administrations. He may not succeed, and, to make up for that failure, he may revert to the ways of the strongmen that have come before him. The biggest criticism one hears of him is that he’s impetuous and erratic. But he has started off on a strikingly positive note, and there’s reason to hope that he sticks with it.

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