A 12-year-old Afghan girl and her mother lose their jobs when the Taliban closes the hospital where they work. The Taliban have also forbidden women to leave their houses without a male "legal companion." With her husband and uncle dead, having been killed in battle during the Soviet invasion and their civil wars, there are no men left to support the family. Unable to leave the house without fear of arrest and torture, the mother is left with nowhere to turn. With no other choice, and inspired by a story her mother tells about a boy who went under a rainbow and became a girl, she disguises her daughter as a boy named 'Osama'. Osama manages to secure a job at the local chai tea shop, but 'his' effeminate ways quickly arouse suspicion among the other boys.
Eventually, in a drive to collect soldiers, the local boys, including Osama, are taken from their homes or work by the Taliban to be trained as soldiers. At the training school, they are taught how to fight and conduct ablutions, and Osama realizes it can only be so long before she is found out. Several of the boys begin to pick on her, and eventually her secret is outed in one of the movie's most vicious and disturbing scenes. Arrested, she is put on trial, and as this case is without precedent, her life is spared when she is given in marriage to a man who delivered a videotape filmed by a western journalist who is also being tried. The new husband already has three wives, all of whom hate him and say that he destroyed their lives, and they take pity on her.