Even if chasing her athletic ambitions were only a matter of physical ability, odds would already be stacked against Zainab*. For two months leading up to Afghanistan’s first official marathon in Bamiyan this month, her fitness regime was limited to jogging laps in her family’s small backyard because running outside was unsafe.

A marathon is exhausting for most practitioners, but few have to muster the additional willpower to endure the kind of abuse Zainab, 25, faces each time she laces her trainers to venture outdoors.

In August, she ran an unofficial marathon from the Paghman Valley to Kabul with three other young women. As they entered the capital, they were bombarded with the kind of insults reserved for Afghan women who have the audacity to do anything out of the ordinary in public.

“The children were stoning us, the people said bad words like ‘prostitutes, why don’t you stay at home? You are destroying Islam’,” Zainab recalled. The women had to cut the race short. After that, the father of her training partner, Nilofar, forbade his daughter to run the Bamiyan marathon.

Zainab’s own parents are proud of her running, she said. Her mother does worry about her athletic daughter, though she sometimes joins her running around the backyard, along with Zainab’s sisters. Her brother, a student in Germany, has taken up kickboxing and runs regularly with his friends.

Bamiyan, home of Afghanistan’s Hazara minority, is known as the country’s safest region, and one of the most liberal. It was the natural place to organise Afghanistan’s first marathon, which drew around 35 runners, including Zainab as the sole Afghan woman. About 80 people competed in a simultaneous 10km race, of whom half were girls.

Zainab ran with a Canadian and a Belgian woman from Free to Run, an organisation working to improve women’s and girls’ access to sports. Having arrived in Bamiyan 24 hours earlier, too late to acclimatise to an altitude of 3,200 metres, Zainab knew she would struggle and, at the start line, she had trouble breathing.

The weather in the Afghan highlands is mercilessly cold in the winter. In October, Bamiyan was already so chilly that few of the runners seemed to break sweat, even under a clear, sunny sky. The marathon course snaked its way over softly curved hills and through jagged gorges, alongside rippling creeks and sporadic patches of green.

Running along vast dry plains, and through tiny windswept villages, Zainab drew attention, but none of it malicious. Herders and farmers on donkeys eyed her curiously. Young children followed her excitedly until they ran out of breath. Some male competitors did accuse her of cheating, even though several of them rode part of the course on the back of motorbikes.

As she trekked up the last steep hill to the finish line, local dignitaries and about 40 girls who had just completed the 10km race cheered her on.

“Bamiyan is a good place for this. In other places, they would be killed,” Bamiyan’s governor, Zahir Tahir, said.

Prior to the marathon, Zainab had received a celebrity welcome at a local high school where students had been asking about “Miss Zainab” for days, waiting for her to deliver a motivational speech for the girls participating in the 10km run.

“They were really ready for running,” Zainab said. “They are really strong. They are faster than me.”

Zainab was born a refugee in Iran, where her family moved during the Soviet invasion. She grew up playing basketball. She returned to Afghanistan with her mother, three sisters and brother in 2004, and is now the main breadwinner for the family, working for Skateistan, an international skateboarding charity, while studying international relations at university. Her father, a labourer, stayed behind in Mashhad.

Sport has become, for Zainab, a tool to encourage Afghan women to defy cultural norms and assert themselves in society. As part of a generation that hardly remembers Taliban rule, and whose values evolve faster than those of society, Zainab has seen many male figures of authority try to thwart her few options to exercise.

Zainab and her running partners draw attention as they run the Bamiyan marathon. Photograph: Janus Engel Rasmussen

She enrolled in a girls’ taekwondo club until police shut it down. When she discovered Skateistan, skaters had to assure suspicious local clerics that the Qur’an was recited before each session. Zainab only started running last year, after Skateistan trainers convinced her to apply for a grant from Free to Run to compete in an ultramarathon in China’s Gobi desert.

“When I applied for the ultramarathon, I had one goal: to open the way for other girls in Afghanistan – in other parts of society as well, but especially sports,” Zainab said. Much to her surprise, she and her friend Nilofar were selected.

“They said, ‘it was because of your ideas, not your physical ability’,” she said. Free to Run tailored a five-month training course for Zainab and Nilofar, and flew them to China in May. “My life changed, totally changed,” she said.

However, Zainab’s participation in a marathon in Afghanistan holds more symbolic importance as it “opens up a large amount of space for other Afghan women to follow in her footsteps”, said Free to Run’s founder, Stephanie Case. “In Afghanistan, where women are largely confined to the indoors, when you run and when you hike and do outdoor activities, you are reclaiming public space,” Case said.

Pushing herself, like most long distance runners, to the brink of physical and mental exhaustion, has taught Zainab a lesson she now applies in life. “Everything is in your mind,” she said. “You don’t have to train a lot. I didn’t have training but I have done it.”

But equal opportunity in Afghanistan depends on more than sheer willpower. For Afghan women, straying from society’s norms can be dangerous. A brutal reminder of this was the mob murder in Kabul in March of Farkhunda, a female Qur’an teacher falsely accused of blasphemy after getting into an argument with a cleric.

The killing shocked women across the country. At the time, Zainab was still training with Nilofar, running in the mountains outside their hometown. “In those days I was so worried, I didn’t go to the mountains. I stopped training,” Zainab said.

Two weeks later, though, they went back out. And, Zainab said, if she can convince her friend to keep training outside, they can shoulder the harassment together. “We’re getting used to it. We shouldn’t care about it,” she said

* For security reasons Zainab’s last name and her home province have been omitted