Ashraf Ghani yearned to go down in history as a visionary leader who brought lasting peace and modern governance to his country. Instead, the professorial Afghan president, 72, departed power abruptly and in silence on Sunday as Taliban fighters poured into the capital, and their extreme Islamist leaders prepared to dominate the country’s political future.

Ghani’s forced exit, more than three years before his second term was due to expire, was a humiliating end to his ambitious but troubled time in office. His first term began in 2015 as a salon for grand ideas, many developed during his career as an academic and World Bank official. But his administration, propped up by American funds, was weakened by petty political rivalries and undercut by the pressures of an unwinnable war.

Sidelined from a U.S.-Taliban peace deal in 2020 that critics said gave the insurgents far too much leverage, Ghani lost further luster after a questionable reelection bid. Unpopular with the public, often described as abrasive to underlings and impatient with fools, he relied on a steadily shrinking circle of advisers. Ultimately, he had to step down to prevent a bloodbath.

“Ghani failed to address the needs of the Afghan security forces, which was exploited by the Taliban. But in the end, his downfall was due to his stubborn insistence on clinging to power, even when the country’s interests, including the pursuit of peace, were better served by his relinquishing it,” said Michael Kugelman, deputy director of the Asia Program at the Woodrow Wilson Center for International Scholars in Washington.

Thousands of panicked Afghans and foreign nationals gathered at Kabul airport on Aug.16, as the Taliban declared victory in the war in Afghanistan. (Reuters)

Ghani’s overarching ambition — to transform Afghanistan from a tribal, patronage-based society to a modern technocratic state — initially impressed many Afghans. After post-Taliban stints as finance minister and other roles in the government of president Hamid Karzai, he often lectured on the issues facing struggling societies. He co-authored a book with proposals for “fixing failed states.”

Many voters, including young adults in the emerging urban society of post-Taliban Afghanistan, were inspired by his plans to replace strong-arm and personality-cult politics with professionalism and merit. Young women were inspired by his wife, Rula, an articulate and liberal Lebanese Christian.

Yet although Ghani often donned elaborate tribal turbans at campaign events, his academic prescriptions never resonated for many poor Afghans, said Ronald Neumann, the U.S. ambassador in Kabul from 2005 to 2007. He described Ghani on Sunday as “brilliant, but someone who doesn’t listen well.” U.S. advisers urged him to be patient and focus on one project at a time, but he took on too much, Neumann said, and “spread himself too thin.”

As the war continued, Ghani, who earned a doctorate at Columbia University and spent much of his career in the United States, was accused of fiddling while Afghanistan burned. While the militants were out in the dark, bombing convoys and attacking police posts, Ghani could often be found giving energetic speeches on topics from improved agricultural production to civil service reform.

But even as critics called him arrogant and harsh, the president felt emasculated and undercut by U.S. officials when their 2020 pact with the Taliban ignored basic Afghan interests and led to the release of thousands of Taliban prisoners, which Ghani had strongly opposed. As his efforts to promote peace talks among Afghan leaders floundered, he frequently expressed his bitterness.

“People saw Ashraf as a spoiler, but the U.S. betrayed him on the deal,” Neumann said.

From the beginning, Ghani’s presidential tenure was poisoned by internal feuding, particularly with Abdullah Abdullah, his top rival in the elections of 2014 and 2019. The first was so tainted by charges of fraud that the United Nations organized a hasty recount. When that proved inconclusive, John F. Kerry, then the U.S. secretary of state, had to broker a power-sharing deal between the two; an arrangement that proved tense and divisive.

Five years later, with the war still dragging on, the two men competed again in an election that critics said should be postponed until peace talks could take place. Ghani insisted that the vote proceed, but the result was so close that Abdullah refused to concede and threatened to form a parallel government. Both men held competing inauguration ceremonies just a few blocks apart with tensions high and gunmen on guard. One American official called the scene surreal and depressing; a former intelligence chief called it a huge risk.

“We are on the edge,” Rahmatullah Nabil, the ex-intelligence chief, said at the time. “If things deepen, it would only take one spark. We could end up with government troops fighting the Taliban and each other.”

If the two leaders failed to call off their cold war, he said, “whatever happens will only favor the Taliban.” Eventually, Abdullah agreed to stand down.

Another sign of the contradictory tugs between Ghani’s reformist ideals and political cynicism was his relationship with Gen. Abdurrashid Dostum, a powerful ethnic Uzbek warlord. Ghani once denounced him as a cold killer, then named him as a running mate. In 2017, Dostom was accused of ordering the rape of an elderly political rival. But when Dostom defied arrest, Ghani and his advisers declined to push further.

In 2020, he promoted Dostom to marshal, the country’s highest military rank. And this month, with Taliban forces sweeping across the country, Ghani belatedly flew to the north to ask two anti-Taliban warlords, including Dostom, for help.

Soon, both of their stronghold cities were overrun by the militants, and Ghani was alone again.

In recent weeks, as Taliban fighters were overrunning district after district across the country, the president appeared to be in shock or denial. He made no public statements about the conflict and gave no news conferences. On Saturday, the government broadcast a brief video in which Ghani praised the Afghan security forces and declared they had the fortitude to win. He made no mention of resigning, although some aides reportedly had expected him to do so.

But on Facebook early Sunday, Ghani posted a terse message saying, “In order to avoid a flood of blood, I thought it was best to get out.” By evening, news videos showed Taliban fighters in turbans and tunics, many carrying weapons, milling about inside the presidential palace.