In Afghanistan, ranked the worst country in the world to be born a girl, some parents are bringing up their daughters as sons. Then comes puberty and the ‘bacha posh’ are expected to to switch back

Watching Mehran, age six, play football at her school in Kabul, you would think that being a girl in Afghanistan wasn’t so bad at all.

As she moves in and out of the game on the sparsely covered grass lawn, her expression of focus shifts to a satisfied grin when she finally gets to the ball. Barefoot in dusty sandals, she kicks it as hard as she can into the field. Her shirt hangs loosely over her pants, and her short, black hair spikes out in every direction. She’s messy now – dirty even – but she doesn’t much care. There is no need for Mehran to be pretty, or to appear “proper” or shy, as is required and expected of other Afghan girls, who refrain from too much physical activity in their demure dresses and all their hair carefully tucked in under head scarves.

This – to be one of the boys – is Mehran’s privilege.

Mehran is a bacha posh – the literal term translated from Dari for a girl “dressed like a boy” in Afghanistan, the country that the UN says is the worst in the world to be born a girl, and where the average life expectancy of a woman is 44 years. The bacha posh are the secret underground girls of this deeply conservative society, where men and boys hold almost all the privileges, and where the mother of a newborn girl is often greeted with disappointment for not having brought a son into the world.

“They gossip about my family,” Mehran’s mother said the first time I met her. She explained how having four daughters had made her decide to bring her youngest to the barber for a haircut a year earlier, and to tweak her name to a masculine-sounding form, in order to present her to the outside world as a son in trousers and a shirt.

When I began my research in 2009, after first meeting Mehran, the existence of these girls was denied by many foreign experts on Afghanistan. It seemed unlikely that the country’s harsh gender segregation would allow for such deviations. But it is an ancient practice that Afghans can reference as far back as the time before Islam took hold in the country.

In a collective deceit that is perhaps best described as a version of “don’t ask, don’t tell”: each Afghan family will keep the secret of such a child to themselves, which is why there are no exact numbers on bacha posh in the country. But during my five-year investigation of the practice, I have interviewed dozens of these girls, as well as adult women who have had the experience of growing up as the other gender, adopting both the exterior and the behaviour of Afghan boys.

Mehran Rafaat playing in the alley outside her family home in Afghanistan. Photograph: Adam Ferguson

These children, who could almost be said to represent a third gender, cut through ethnic groups and across geographical lines. According to Afghan teachers, midwives and doctors, it is “not uncommon” to find a bacha posh in each school or extended family, because it is easier to have access to an education in the most conservative areas, where few girls are able to go to school. The family may also need a child who can move around more, who can work or run errands for the family, or escort sisters. But while Afghan society largely accepts the apparent contradiction of bacha posh in small children, it also requires that all girls eventually follow the path of a “proper” Afghan woman. Most importantly, that entails marrying and having children of her own. Accordingly, she must be shown to be pure and well-behaved from the time she is no longer a child, and enters puberty. That is the time when the curtain inevitably comes down for most bacha posh, and she is brought a dress and required by parents to make a seamless transition into becoming a young woman and prepare for marriage.

The bacha posh who has spent her life thus far as a boy may by then have a very dim view of what goes on among young women. Often, in Afghanistan, young girls are far less physically active and have been taught to never speak up or raise their voices; they are expected to know more about cooking and romantic Bollywood movies than how to shoot a gun and carry oneself, hips forward in leather jacket and jeans. Some girls simply refuse their parents. “All the work that boys can do, women can do too. I know it, because I do it,” said one 15-year-old bacha posh to me, who has no intention of ever going back to be a woman or limiting her freedom of movement, after having lived all her life as a boy. One married mother of three, who lived for 20 years as a boy and a young man before she was forcibly turned into a woman and married off to a man of her parents’ choice, confirmed to me that there is both an element of resistance as well as confusion that remains from having grown up on the other side.

Mehran Rafaat with her mother at their family home. Photograph: Adam Ferguson

“I had to change my thoughts and everything inside my mind,” is how she describes the difficult transition to a more confined existence as an obedient Afghan wife.

In essence, the practice of bacha posh speaks perhaps not so much to the fluidity of gender, but rather begins to crystallise as one of the clearest symptoms of a segregated society so dysfunctional that it inevitably must change. When one gender is so suppressed and so unwanted, there will always be those who try to pass over to the other side, to reach for the small freedoms every human should have. It also has historical parallels throughout societies that were repressive to groups for reasons of religion and race.

In the efforts of the western world to both understand Afghanistan and help advance its women, more than $30bn (£18bn) was spent on development aid between 2006 and 2011. During that time, in a single year, more than 700 projects relating to gender were sponsored by foreign donors. We now leave an Afghanistan behind where the rights of women have only been marginally improved.

That bacha posh has existed right under the surface as a way to creatively buck a system of gender segregation for this entire time should prompt us to ask what else we were missing in our decade-long effort to turn around one of the world’s poorest and most undeveloped countries, where being born a girl always required survival efforts and a resilience that we could have never imagined.

The Underground Girls of Kabul by Jenny Nordberg is published by Virago on 30 September at £14.99. To order a copy for £11.99 with free UK p&p go to guardian.co.uk/bookshop or call 0300 333 6846.