CNN is committed to covering gender inequality wherever it occurs in the world. This story is part of As Equals , an ongoing series

Sanjoor, Afghanistan — At first glance, 13-year-old Mangal Karimy could be any boy living in a small village in western Afghanistan, hauling firewood and feeding cattle on his father's farm.

Silently he hurries between chores -- a slight figure in luminous white trainers, lugging jerry cans of water across barren fields.

Until the age of two, Mangal was Madina, one of seven daughters chosen by her parents to live as a boy under an Afghan tradition called "bacha posh," a Dari term that translates to "dressed as a boy."

For as long as Mangal can remember, he tucks his long hair under a woolen cap, pulls on his jacket and trousers and helps his father tend their wheat and dairy farm in the snow-capped village of Sanjoor, in Herat province.

In Afghanistan's deeply patriarchal society, sons are highly valued over daughters -- to the point where a family is deemed "incomplete" without a boy, says Nadia Hashimi , an Afghan-American pediatrician and author of the best-selling 2014 bacha posh novel "The Pearl That Broke Its Shell."

Girls are brought up believing they are a burden on the family, said Sodaba Ehrari, Chief Editor of the Afghanistan Women News Agency (AWNA), who has interviewed several parents of bacha posh children. Women "cannot earn money to support their families, they cannot live alone -- and so many reasons (like this) lead them in this patriarchal society to practice bacha posh," she said.

The centuries-old tradition says much about the discrimination faced by Afghan girls quite literally from the moment they're born. After all, "no one who has only sons is transforming them into a daughter," Hashimi says.

The transition is temporary, and bacha posh children are expected to shed their male identities once they hit puberty and return to living as girls -- something that doesn't always come easily.

Underpinning the custom is the superstition that a bacha posh child will "turn the hand of fate, so that the next child born into the family will be a boy," Hashimi says.

Mangal's father, Khoda Bakhsh Karimy, told CNN that should the family have a son, the child would return to living as a girl. Until then or the point when Mangal hits puberty, Khoda and his wife Amena Karimy were "happy" with Mangal and the responsibilities he carries out, like "welcoming guests to our home and offering them tea or food."

'I made my daughter like a boy'

After having two girls, Mangal's parents longed for a son. "We made her like a son to help her father," said mother Amena.

"I made my daughter like a boy to serve me food and water when I am working in the desert," father Khoda said.

In the Dari language there are no gender pronouns "he" and "she." But Mangal told CNN he preferred being referred to by his male identity -- and the English equivalent "he."

His parents meanwhile, believe that Mangal's gender at birth -- female -- remains unchanged. The English translation of their conversation uses the pronoun "she."

Mangal is a cherished extra pair of hands for the family of nine who earn around 6,000 Afghani (around $80) per month -- meager even by Afghanistan's standards.

Bacha Posh child Mangal Karimi and her family

"I love all my daughters but I love Madina more as I ask her to do work like 'go take care of the cattle' or 'bring something to a neighbor,'" says Khoda. "Otherwise there is no difference between them."

Author Hashimi says that Afghanistan's love for its sons has practical roots. In this agricultural economy it's the boys who chop wood, plow the field, travel independently and work outside the home, she says. And when they marry, their wives -- and the next generation of children -- are absorbed into the family.

For girls, it's a very different story. A daughter is expected to be "demure" and "help with domestic chores," says Hashimi. Outside the home, a girl "haggling in the market" or "looking adults in the eye" would come as a shock for some people, she adds.

For parents without a son, bacha posh is a workaround to these obstacles that cuts across socioeconomic lines. Data on the practice is scarce, but Hashimi says almost every Afghan she interviewed for her book knew of a bacha posh child -- regardless of region or class.

'People kind of go along with it'

Sitting beside his father in their simple mudbrick home, softly spoken Mangal keeps his answers brief. With a shy, quick smile, he says that "yes" he likes being a boy and prefers being referred to by the English pronoun "he."

But, he adds: "I would like to go back to being a girl when I grow up."

When not helping on the farm, Mangal says, he likes to play football with other boys in the village, where he is the only bacha posh child.

His father, Khoda, says neighbors have been accepting of Mangal, only telling him that the child "should wear girl's clothes when she grows up."

To which Khoda replied: "Of course."

Even when people realize a child is, in fact, a girl dressed as a boy, "they kind of go along with it," explains Hashimi.

"There's this understanding that the family is using this loophole to get around this void, to try and right their family, and have a source of honor and pride," she says.

Bacha Posh child Mangal Karimi and her family

Mangal occupies a blurred space between daughter and son. When not working on the farm, he attends a girls' school along with four of his sisters. But he does so dressed as a boy and known by his male name.

"No, I don't consider him like a son," says Khoda. "We know she is a girl, in the future she must wear girl's clothes and marry someone."

Each family has their own take on bacha posh. Journalist Ehrari said some parents told her they were "trying to hide or don't want to show others that they have daughter." A son is a source of pride, whereas "having a daughter is a shame," they said.

Other parents said they desperately wanted their daughters to "have achievements." But in a society where "everything is just for men," bacha posh was the only way "their daughters could live in freedom," said Ehrari.

Their clothes might be different, but the inequality remains, said Ehrari. "This is an injustice against women, that they can't be themselves and live like a woman freely."

'There were so many advantages and disadvantages'

Making the transition back to living as a girl -- particularly after a brief glimpse of male freedoms -- can be a painful process.

Shazia, who did not want her last name published, was nine years old and living in Kabul in 1990 when her parents decided to transition her to bacha posh for five years.

With civil war raging, Shazia's parents had already sent her two older brothers away to Russia to avoid them being drafted. But when her father -- a middle-class businessman dealing in imports and exports -- lost his leg in an accident, her mother and the remaining six daughters were left without a breadwinner.

"That's when my family decided for me to dress up as a boy," says Shazia, who, as the third daughter, was deemed old enough to help her mother outside the home -- but still young enough to pass for a boy.

"I had to play the role of a son," says Shazia, who went by the male name Mirwas and was made to cut her hair and wear boys' clothes.

The simple home where Mangal Karimy lives.

Practically overnight Shazia's daily chores changed dramatically -- from "cleaning and feeding the chickens" to "accompanying my mum at the local market." Sometimes Shazia would even get groceries alone, something she described as a "huge undertaking, especially for a young girl."

"There were so many advantages and disadvantages to being bacha posh," says Shazia, today a 37-year-old mother of three daughters, working for a women's NGO in the United States.

As "Mirwas" she could "fly kites, play soccer with neighborhood kids, ride my dad's bicycle -- all of which were not ordinary activities for a girl in Afghanistan," Shazia told CNN by phone from her New York home.

But she was also bullied by her sister and cousin for wearing boys' clothes and tasked with the most grueling chores. "During the harsh winter I would have to stand in a line and receive bread to feed my family," Shazia says. "I was jealous of my sisters in the house, warm."

'I was stuck between being a girl and boy'

While the immediate family knew Shazia's true identity, the wider neighbourhood was unaware, and she describes the torment of "playing two different roles in society."

"I felt particularly insecure about my facial features, my clothes, my stature compared to boys my age," she says. "This imposed lifestyle was not my choice. I was stuck between being a girl and boy."

Hashimi says this transition between genders is "essentially imposing an identity crisis on a young psyche." She says that the bacha posh tradition could induce a "gender dysphoria" where children are "simply not content with their biological gender and feel like they belong in a different world."

Shazia's return to girlhood came at 13 when one of her older sisters intervened, telling the family "this is enough."

"My sister was really, really tough," says Shazia. "She beat me up, she threw out all my male clothes, she said 'you have to become a girl.'"

Shazia's parents agreed and gradually she emerged into the world as a girl again, at first fearful of going "outside because my neighbors would see me" and "wearing a big scarf until I had grown my hair long enough."

A few months later, the family moved to Pakistan and Shazia was able to fully embrace her female identity. But years of boyhood, or having a masculine identity, "left me confused about my identity," she says.

Bittersweet return to girlhood

For many bacha posh children, becoming a girl again can be bittersweet says Hashimi. "It's an experience of what it's like to be on the other side, in a country where those two sides are remarkably different." In extreme cases, she says, they may even refuse to return to living as women at all.

With so little data available, it's hard to say whether the practice is dwindling or growing. But Hashimi believes bacha posh will ultimately "die out as Afghan society continues to advance the place of women in society."

In recent years the Taliban has strengthened its grip over Afghanistan -- between 60% and 70% of the country is now contested or under its control. As the Islamist militant group gains ground, gender inequality -- and the need for bacha posh -- will continue, said Hashimi.

Each year, the advocacy group Women for Afghan Women assists at least two bacha posh cases at its women's shelters across the country. The girls, aged between 14 and 18, "are not in a stable emotional, mental and financial state," said the group's executive director, Najia Nasim.

Many are referred to the shelters by police. The girls are usually "friends with boys and have more freedom," said Nasim. She added that they "often end up being abused" by people making them "dance, drink and (take part in) sexual activities."

Such girls might end up in a "special prison for children under 18 called a rehabilitation center," Nasim said. With the help of mediators and mental health services they could also be re-integrated into their families, she added.

CNN contacted the Afghan government for comment on its position on bacha posh but did not receive a reply.

Bacha Posh child Mangal Karimi and her family

But the Afghanistan Women News Agency's Ehrari said that the government has traditionally not spoken out against bacha posh, because it believed the practice "comes from the Afghan culture and was a custom which couldn't be changed."

Through family connections, Shazia was married at 18 to an Afghan man living in New York. While her husband is "fully supportive" of her bacha posh past, the couple have never discussed it at length, she says. Instead, it was her 17-year-old daughter who encouraged Shazia to share her story publicly for the first time.

"I have three girls. And people would tell me 'oh you should really have boys, try to have boys.' I said 'No, there's nothing boys can do that girls can't,'" Shazia says.

"Girls are not a burden. They are really a blessing."

Meanwhile back in Sanjoor, Mangal continues with his daily chores, diligently shoveling soil alongside his father in the winter chill.

A group of younger neighborhood boys watch from a short distance. Mangal's sisters remain inside the home, hidden from view.

A freelance journalist contributed to this report from Sanjoor, Afghanistan, while CNN's Ehsan Popalzai contributed from Kabul.