In Kabul's political circles, they are known as the "Beiruti boys" – part of a generation of Afghan leaders who shaped their politics in the sandstone corridors of the American University of Beirut, where they studied together in the 1970s. By 2018, Zalmay Khalilzad had become the US Special Representative for Afghan Reconciliation, and Ashraf Ghani was Afghanistan's president. They were two halves of a US-Afghan equation to find a solution to the resurgence of the Taliban, which was sweeping through Afghanistan while remaining uncompromising in peace talks with the Afghan government in Doha. They were often at loggerheads. Their mutual suspicion and, ultimately, their failure to agree were partly responsible for the calamity that would eventually befall the Afghan government in August, when the Taliban captured Kabul and Mr Ghani unceremoniously left his post. On Monday, more than two months after those events, Mr Khalilzad himself resigned. The first time Zalmay Khalilzad and Ashraf Ghani got to know each other was not in Beirut, nor in Kabul. It was in Manhattan, in the summer of 1966, when they were among a handful of Afghan high school students chosen for a year-long exchange programme in America. Their orientation in New York was meant to acclimatise them to American life; for the young Khalilzad, it was his first time riding in a lift, or using a shower. The Afghanistan they had come from was among the poorest places in the world, and the two of them were recognised by US embassy officials in Kabul to be among the nation's best and brightest. So it was unsurprising when, a few years later, they got USAID scholarships to go to Beirut, where they studied politics under Arab and American professors as they witnessed Lebanon gradually slide into civil war. In a sense, so much of what has transpired in Afghanistan over the past three years was written in Beirut. According to people who knew them then, the heady atmosphere of being a politics student in a city brimming with so much politics turned Mr Khalilzad and Mr Ghani into very different people. Mr Khalilzad was less ideological. He liked to work the room, so to speak, and find compromise in unlikely corners. In debates on campus about the conflict in Palestine and Israel, he supported a two-state solution on the basis that it was "eminently sensible" – a view most of the student body at the time thought was ridiculous. He was also elected president of the Association of Afghan Students after giving a speech warning of growing communist influence in Afghanistan. His opponent accused him of being "unserious about politics" and "pro-American". On the latter point, Mr Khalilzad says in his memoirs that he most certainly was. Mr Ghani, on the other hand, was bookish, and kept mostly to himself. He was a stubborn socialist, and favoured action over concessions. When Daoud Khan, an autocratic general, overthrew Afghanistan's monarchy in 1973, Mr Ghani returned home to teach at Kabul University. Khan's Afghanistan was not a place Mr Khalilzad, on the other hand, wanted to go back to, and the country's radical politics were, to him, part of a regional pattern that only deflated his sense of patriotism. "The more I learned about the broader Middle East," Mr Khalilzad writes of his time in Beirut, "the more ashamed I became of Afghanistan's particular plight." If the people who had known them back then were told that one would eventually become a divisive, embattled Afghan president and the other a jet-setting US diplomat, it might have been easy to guess which would become which. Mr Khalilzad gradually detached himself from Afghanistan altogether, becoming a US citizen working at a think tank, writing papers on American policy towards Iraq, China and North Korea. Mr Ghani eventually became a US citizen, too, after taking jobs at US universities in the aftermath of Afghanistan's communist revolution. When the US invaded Afghanistan in 2001, Mr Khalilzad was plucked from relative obscurity and transformed by the US policy establishment into an Afghan-American point man. Mr Ghani, meanwhile, returned home to work on the Afghan side, and relinquished his US passport when he made a bid for the presidency. By 2018, Mr Ghani's government was in jeopardy, and he often appealed to the US for urgent assistance. In reality, he was appealing to Mr Khalilzad, who by then had become America's top diplomat on all things Afghanistan, having also spent short stints as Washington's ambassador to Iraq and the UN. Although Mr Ghani had the bigger title, as Afghanistan's president, in many ways Mr Khalilzad was his true American counterpart rather than the occupant of the White House. It will have been difficult to separate the intimacy and history between them from the intimate, but much younger history between America and the Afghan republic. They certainly tried. "This is not about Zal and Ashraf," Mr Ghani told Mr Khalilzad in one of their first meetings after peace talks between Kabul and the Taliban began. "This is now about the US and Afghanistan." And yet, so much of it seemed personal, and in line with who "Zal" and "Ashraf" are. Mr Ghani became known in Afghanistan as a somewhat-autocratic populist, refusing to make compromises with his enemies and frequently shifting blame for his administration's failings onto alleged US conspiracies. Mr Khalilzad, in his handling of America's interests in Afghanistan, often breathed life into those allegations. The two reportedly had shouting matches often, in which Mr Khalilzad accused Mr Ghani of stubbornness, and Mr Ghani accused Mr Khalilzad of being unprincipled. Whereas Mr Ghani refused to speak to the Taliban, Mr Khalilzad "worked the room". He used his tenure as peace envoy to negotiate side deals between the US and the Taliban, including the famous February 2020 bilateral agreement in which the US gave a timeline for its withdrawal on spurious conditions. It was made without consulting the Afghan government at all, and historians may come to view it as the beginning of the end for the Afghan republic. It is clear to many Afghans today what was clear to Mr Ghani and Mr Khalilzad's classmates five decades ago: Mr Ghani was too deeply entrenched in a singular and probably unworkable vision for Afghanistan. Mr Khalilzad was detached from any vision at all. It is remarkable that it was Mr Ghani who abandoned the country prematurely, and Mr Khalilzad who stuck around longer than most Afghans would have liked. Now, with Mr Ghani in exile and Mr Khalilzad having written himself out of Afghanistan's future, the era of the Beiruti boys is over. What was about Zal and Ashraf is over. And what was about the US and Afghanistan is over, too.