Though the attack was shocking, cricket and conflict have long been connected in Afghanistan: It was the war with the Soviet Union that forced Afghans into the Pakistani refugee camps where they were introduced to the game. This provenance created the impression for some that cricket was a foreign import. But the successes of recent years — and the carousel of homegrown heroes like Mr. Khan — have forged widespread affection for the national team.

When I visited Afghanistan in late 2014, Mohammad Nabi, then the national team’s captain, showed me a clip on his phone: People hung from billboards lining the Kabul International Stadium to watch a domestic match, the ground overflowing. I met the father of a young cricketer, Fareed Ahmad, in the outskirts of Jalalabad; he carried a gun and a cellphone, the latter to show people how well his son had bowled in an Under-19 match.

It is a testament to how quickly these cricketers have developed that even their fathers don’t know much about the sport. During the prime of their lives, all they could do was keep their families alive. Most fled to relative safety, before setting off to work in Dubai. Not all of them succeeded, but when the survivors returned they found the war had turned their beautiful home into a wasteland. Olive fields were now just a desert. Buildings were debris. Some of today’s international cricketers’ first changing rooms were felled aircrafts, their playing fields muddy and their first shoes flip-flops.

Yet they marched on. In 1995, practically no one in Afghanistan knew what cricket was; by 2015, the national team was at the World Cup. In 20 years the country’s cricketers had achieved what other teams take 50 years to do — and in the process they became the darlings of world cricket. A fast bowler wore war paint, another let his long hair bounce as he ran in to bowl, their batsmen hit with abandon, they argued animatedly with one another on the field, and when they celebrated, the world celebrated with them. They were pure drama.

The 2015 World Cup was supposed to be a watershed moment. For once Afghanistan was not only about drugs and terror. And yet, in 2017, Shapoor Zadran, the tall left-arm fast bowler who hit the winning runs in their first-ever World Cup victory, was attacked by terrorists, and not for the first time. Four years previously, Mr. Nabi’s father had been kidnapped.