The novel is divided into four parts. The first part focuses exclusively on Mariam, the second and fourth parts focus on Laila, and the third part switches focus between Mariam and Laila with each chapter.
Mariam lives in a Kolba on the outskirts of Herat with her mother. Jalil, her father, is a wealthy man who lives in town with three wives and several children. Because Mariam is his illegitimate daughter, she cannot live with them, but Jalil visits her every Thursday. On her fifteenth birthday, Mariam wants her father to take her to see Pinocchio at his movie theater. When he does not show up, she hikes into town and goes to his house. He refuses to see her, and she ends up sleeping on the porch. In the morning, Mariam returns home to find that her mother has hanged herself out of fear that her daughter has deserted her. Mariam is then taken to live in her father's house. Jalil arranges for her to be married to Rasheed, a shoemaker from Kabul who is thirty years her senior. In Kabul, Mariam becomes pregnant seven successive times, but is never able to carry a child to term, and Rasheed gradually becomes more abusive.
In the same neighborhood live a girl named Laila and a boy named Tariq, who are close friends, but careful of social boundaries. War comes to Afghanistan, and Kabul is bombarded by rocket attacks. Tariq's family decides to leave the city, and the emotional farewell between Laila and Tariq ends with them making love. Laila's family also decides to leave Kabul, but as they are packing a rocket destroys the house, kills her parents, and severely injures Laila. Laila is taken in by Rasheed and Mariam.
After recovering from her injuries, Laila discovers that she is pregnant with Tariq's child. After being told that Tariq is dead, she agrees to marry Rasheed, who is eager to have a young and attractive second wife, and hopes to have a child with her. When Laila gives birth to a daughter, Aziza, Rasheed is displeased and suspicious, and he soon becomes abusive toward Laila. Mariam and Laila eventually become confidantes and best friends. They plan to run away from Rasheed and leave Kabul, but they are caught at the bus station. Rasheed beats them and deprives them of water for several days, almost killing Aziza.
A few years later, Laila gives birth to Zalmai, Rasheed's son. The Taliban has risen to power, and there is a drought, and living conditions in Kabul become poor. Rasheed's workshop burns down, and he is forced to take jobs he is ill-suited for. Rasheed sends Aziza to an orphanage. Then one day, Tariq appears outside the house. He and Laila are reunited, and their passions flare anew. When Rasheed returns home from work, Zalmai tells his father about the visitor. Rasheed starts to savagely beat Laila and Mariam kills Rasheed with a shovel. Afterwards, Mariam confesses to killing Rasheed, in order to draw attention away from Laila and Tariq, and is executed, while Laila and Tariq leave for Pakistan with Aziza and Zalmai.
After the fall of the Taliban, Laila and Tariq return to Afghanistan. They stop in the village where Mariam was raised, and discover a package that Mariam's father left behind for her: a videotape of Pinocchio, a small pile of money and a letter. Laila reads the letter and discovers that Jalil regretted sending Mariam away. Laila and Tariq return to Kabul and fix up the orphanage, where Laila starts working as a teacher. Laila is pregnant with her third child, and if it is a girl, it is suggested she will be named Mariam.