Ten-year-old Obayda, the youngest of four sisters in an Afghan family, narrates the story of how a car bombing in a Kabul market changes her life forever. Her father, a police officer, was picking up medicine for her cough when a car exploded nearby, destroying half of his leg. Obayda ran through the smoke and, with the help of strangers, dragged him from the burning wreckage. After weeks in the hospital, her father returns home physically and emotionally broken, withdrawing into the bedroom and refusing to eat, speak, or leave. The family relocates to his childhood village so his brothers can support them, exchanging their Kabul apartment for a small home with unreliable electricity and the shadow of a local warlord named Abdul Khaliq.
Without a son, the family lacks what the village considers a "backup father," someone who can work and carry on responsibilities. Obayda's aunt, Khala Aziza, the wife of the eldest uncle, pressures Obayda's mother to make Obayda a
bacha posh, an Afghan tradition in which a family without sons dresses a young daughter as a boy. Khala Aziza argues that a pretend son will lift the father's spirits and bring "boy energy" into the home. Obayda and her sister Meena, who is thirteen, eavesdrop on the conversation and hear their mother hesitate but begin to consider the idea.
Three weeks later, the mother cuts Obayda's hair, renames her Obayd, and dresses her in cargo pants and a boy's shirt. Obayda gains freedoms no girl in the village could have: running with boys, climbing trees, and going out alone. The transformation creates immediate tension. The mother serves Obayd the biggest portions of meat while the sisters receive only vegetables and forbids any traditionally feminine behavior. Meena resents the preferential treatment and erupts, accusing Obayda of acting superior.
After a successful solo errand at the village bakery, Obayda's mother enrolls her in the boys' class. Obayda is miserable, too afraid to participate or speak. During recess, a boy wearing a cap embroidered with "W-I-Z-A-R-D-S" singles her out, knocking her down in
ghursai, a physical contest in which players hop on one foot and try to topple opponents. He taunts her about the way she stands and walks. Then he grabs her shoulders and whispers: "I know you because I am you." He, too, is a
bacha posh.
The boy introduces himself as Rahim, formerly Rahima, the middle child of five sisters whose aunt arranged the same transformation when he was nine. Rahim becomes Obayda's best friend and coach, teaching her to stand tall, swing her arms, and move with confidence. He introduces her to his friends Abdullah and Ashraf, who have always known Rahim is a
bacha posh and accept him. During winter break, Obayda discovers that "wizards" means magicians, and the hat takes on deeper significance as a symbol of luck and transformation. Rahim silently reveals what he would do with real magic: become an actual boy permanently.
In the market one day, Obayda spots an old man walking on a homemade crutch fashioned from a tree branch. Inspired, she and Rahim build one for her father using a branch, cardboard, and velvet fabric. When they present it, her father explodes in rage, calling them "weak little freaks" and accusing them of shaming him. The mother quietly places the unused crutch in a corner of the bedroom.
As spring arrives, Rahim confides that his mother may be planning to change him back. He tells Obayda about an Afghan legend: Passing under a rainbow permanently changes one's sex. Around this time, Obayda discovers her mother is pregnant, which means that if the baby is a boy, her role as a
bacha posh will end. She tells Rahim about a waterfall her father described in the mountains east of the village, reasoning that its mist would produce rainbows. Their first attempt to reach it fails when they encounter a snake on the trail at nightfall.
Days later, Rahim stops coming to school. Abdullah and Ashraf reveal that Rahim's father is a war veteran with an opium addiction who works for the warlord. Obayda goes to Rahim's house, where his eldest sister, Shahla, warns her to leave. Rahim's father reveals the devastating truth: Rahima has been changed back to a girl and is engaged to marry Abdul Khaliq.
Desperate to see her friend, Obayda finds the warlord's compound, where she discovers Rahima thinner, trembling, and dressed in a blue dress. Rahima says she hates her new life but cannot escape. She presses the Wizards hat into Obayda's hands and vows to outsmart her captors. As the warlord's jeeps appear, Rahima pushes Obayda away and shouts: "Do everything, Obayd! DO EVERYTHING!" On the road, three jeeps approach. The first passes, the second slows, and the third stops. A guard demands to know what Obayda is doing near the compound. She invents a rambling story about having eaten a cake meant for the warlord and threatens to vomit on their vehicle. The exasperated guards dismiss her and drive away.
Meena discovers what happened and extracts a promise that Obayda will never return to the compound. Alia, another of Obayda's sisters, is tearful at the danger. Using her father's description of the mountain range, which resembles a two-humped camel, Obayda treks alone to the waterfall. She fends off a scorpion, finds the cascade pouring over a drop-off with rainbows in the mist, and steps through a rainbow, drenching herself.
Her mother dismisses the rainbow legend as superstition and declares the
bacha posh arrangement over, confiscating all boy clothes and insisting Obayda wear a dress. Obayda bursts into tears. That night, her sisters stay up whispering with her. Meena suggests the rainbow may have worked in reverse, changing Obayd back into Obayda. Then their father appears in the doorway, breathless and sweating, standing on the crutch Obayda made. He has been searching the streets for hours, his first extended use of the walking stick.
The next morning, Obayda apologizes to her mother, who embraces her and admits that making her a
bacha posh was wrong. The father invites Obayda for a walk, their first outing since his injury. At the village well, he insists on pumping the water himself, needing to prove he can manage alone. He explains that he withdrew from the family because he felt he could no longer be the father they needed, and he announces plans to work with his brother. He introduces Obayda to a neighbor as the one who made his crutch, calling her his "miracle."
Returning to school in a dress, Obayda dreads the attention. During recess, a group of girls chases her across the schoolyard, but they are not hostile: They want to know what it was like to be a
bacha posh. Obayda describes her freedoms, and the girls listen with fascination. In the days that follow, she teaches them
ghursai, and soon their half of the schoolyard fills with girls hopping, falling, and cheering while the boys stop to watch. Obayda's mother gives birth to a baby boy, and the father, now walking daily, takes the whole family on a hike to the waterfall. As they walk toward the camel-shaped mountains, Obayda reflects on everything that has changed: She went from Obayda to Obayd and back, gained and lost her best friend, and discovered that her identity does not depend on the clothes she wears. The novel closes with Obayda watching the mountain's grassy peak bend in the wind like a winking eyelash, as though the landscape shares a secret about what may have quietly changed within her.