A group of female runners who were told at the last minute they could not take part in the Tehran marathon risked being arrested and detained by Iran’s strict religious authorities in order to stage their own race instead.

Around 160 women out of a total of 600 runners had registered to compete in Friday’s first ever ‘TehRUN’, a 26 mile (42 kilometre) race around the Iranian capital, including dozens of foreigners.

However, female participants were dismayed to be told in an email from organisers three weeks ago that they would actually not be allowed to take part, as men and women cannot participate in sports together in the conservative country.

Women laughing at compulsory hijab in Tehran

Iran's track and field federation provided several confusing updates before the event meaning that the day before the race, female participants were still unclear on the rules.

Non-profit ‘Free to Run’, which encourages women and girls mainly from conflict areas to participate in sport and experience the outdoors, said in a Facebook post the week before that the authorities had been listening to the concerns of female runners and it appeared that women would be allowed to compete after all.

On race day, though, it emerged that women could take part in the 10 kilometre run but not the half marathon or full marathon, and those still wishing to complete the full distance would have to use an indoors sports stadium track instead.

"I just feel that when women speak up for themselves that’s when real change comes around," Nike coach Manal Rostom (R) said (Manal Rostom) (Manal Al Rostom)

Since the 1979 revolution Iranian women have had to follow strict dress and behavioural codes in public. Men and women cannot take part in sports together, and are not allowed to be spectators at events involving the opposite gender.

The TehRUN race website also asked female runners coming from abroad to “In general dress modestly to respect local customs and religion,” by wearing long-sleeved t-shirts that cover the hips, and headscarves or bandanas over their hair.

Manal Adel Rostom, a professional runner and Nike coach from Egypt, told The Independent that when she showed up to collect her runner’s bib the day before the race her 125 euro (£107) entrance fee appeared to have been completely wasted.

Women participating in the official 10K race on Friday April 7, 2017 (Karin Brogtrop)

“It was totally chaotic, even the runners' numbers had been mixed up. I was arguing and arguing with the registration guy because I came all the way from Dubai for a marathon, not a 10K,” she said.

“He told me in the end I could show up and run outside if I wanted, but I risked getting arrested.”

Dutch runner Karin Brogtrop also said the experience was “stressful,” but having come so far and trained so hard a group of 12 Iranian and international female entrants decided to bend the rules to run a full race anyway.

They came up with the idea of their own “secret” marathon in the hilly local Beheshte Madaran park, doing 700 metre loops for 32K before joining the official 10K race for women at 4pm, for which they had to don new headscarves and other gear handed out by the race organisers.

A handful of other women tried to run the street route alongside men, women who took part in the Beheshte Madaran park race told The Independent, but were quickly kicked out.

Several women are determined to return to run the official course next year (Manal Rostom) (Manal al Rostom)

“It was a really lovely experience. It was a women’s park but it was family day, so there were men there too. People kept offering us tea or running alongside us,” Ms Brogtrop said. “We had fun. I was happy with it.”

Several of the female runners in the official 10K carried bibs or banners with slogans such as ‘See you next year, 42K.’

“I’m a hijabi and the dress code for this race was in hijab, so this was a great representation of peace and tolerance and the spirit of sport, I think,” Ms Rostom said, adding that she is determined to return to Tehran next year and take part in a full marathon.

“I’m glad we spoke up. I just feel that when women speak up for themselves that’s when real change comes around. As a Middle Eastern woman to see women being empowered in this way and see women run in the streets for the first time means a lot to me, of course.

“It lets [women] know there are no limits and they can do anything they want.”

Friday’s event follows the race’s first incarnation in 2016 in the city of Marvdasht.