Mariam, a young girl, lives in a small shack with her mother, Nana, outside of the city of Herat in Afghanistan. Nana had worked as a housemaid for the wealthy cinema owner Jalil, Mariam's father, but after she became pregnant, Jalil cast her out to the shack. Jalil has multiple legitimate wives and children, but Mariam is an illegitimate "harami" or bastard. Jalil visits Mariam once a week, telling stories and bringing gifts. She adores him. Mariam's other friend, Mullah Faizullah, teaches her the Koran and listens to her problems.
Eventually, Mariam askes Jalil to take her to the cinema to see the new cartoon of Pinocchio. Jalil agrees to do so, but he does not come at the expected time. Mariam ventures into Herat herself. She sleeps outside Jalil's house waiting for him, but he will not see her. Jalil's chauffeur drives Mariam back home, where she finds that her mother has hanged herself.
After Nana's funeral, Jalil takes Mariam in, but she no longer adores him. Jalil's wife tells Mariam that Mariam is to be married off to a shoe shop owner named Rasheed in Kabul. Mariam protests to no avail; Mariam and Rasheed marry and go to Kabul. At first, Rasheed is sweet and brings her gifts. Mariam gets pregnant seven times but loses the baby each time due to a health complication. Over time, Rasheed becomes verbally and physically abusive. At one point, Jalil tries to visit Mariam in Kabul, but she will not see him.
Laila is born sometime after the marriage of Mariam and Rasheed. She lives in their neighborhood. Since her youth, Laila has a close male friend named Tariq. Tariq lost one of his legs from a land mine. As Tariq and Laila grow up, she falls in love with him.
Ahmad and Noor, Laila's two older brothers, leave to fight for the Mujahideen in the jihad. After they are killed, Laila's mother Fariba is never the same. As conflict turns to war in Kabul, living conditions become difficult for everyone. Despite her father Hakim's emphasis on attending school, Laila must quit because the streets are too dangerous. She is tutored at home. Hakim wants to leave Afghanistan, but Fariba will not leave the land for which her sons have died. Tariq's family, however, moves to Pakistan, and Laila feels devastated—before Tariq left, he and Laila had sex. Tariq asked Laila to come with him and marry him, but Laila could not leave her father.
A few weeks after Tariq's family leaves, Laila is almost hit by a bullet. This event wakes Fariba to the ongoing risks of living in Kabul, so she agrees to move. While they pack, a bomb hits Laila's home, and she is the sole survivor of the blast, knocked unconscious.
Laila awakens in Rasheed's and Mariam's house. They took care of her as she healed. After a few days, Abdul Sharif comes and brings news that Tariq had been hospitalized and then died. Laila feels devastated again.
As Rasheed's daily behavior changes, Mariam perceives that Rasheed is courting Laila. She protests, but he does not care. Mariam asks Laila if she would accept Rasheed’s hand in marriage, and Laila answers at once—yes—she is pregnant and wants Rasheed to think that the baby is his. Laila and Rasheed marry, and tension arises between Mariam and Laila. Rasheed puts Laila on a pedestal and makes fun of Mariam in order to impress Laila.
Once Laila announced that she was pregnant, Rasheed was ecstatic. He prayed for a boy and held Laila in even higher esteem. But Laila has a baby girl, Aziza, and Rasheed feels disgusted by the smells and sounds that fill the house. Rasheed soon neglects the baby and implies that he knows the baby is not his.
Soon after the birth, Rasheed demands that Laila have sex with him. Laila refuses because the doctor ordered her not to do so for six weeks. Rasheed blames Mariam, however, and tries to beat Mariam. Laila blocks his blow, the first time anyone has ever stood up for Mariam. The tension between Mariam and Laila thus lifts; Mariam appreciates Laila for defending her. They develop a friendship.
The Taliban come to power, and strict laws are placed on women. The laws are even more severe than Rasheed has been. Women no longer may travel without men, and in general just about all their freedom has been taken away.
Laila had planned to run away from Rasheed soon after Aziza was born. She had begun stealing money from Rasheed in order to put her plan into action. After her friendship with Mariam develops, she invites Mariam to run away with them. To do so, they find a man who seems willing to act as their relative when they buy tickets to Pakistan, but he tells the authorities. They are taken to a police station and are returned home. Rasheed locks them in separate, hot rooms with no food or water for a day. He threatens to kill the three if they attempt to run away again.
Laila becomes pregnant again and gives birth to a boy, Zalmai. Rasheed adores and spoils Zalmai, and Zalmai worships Rasheed. Rasheed's shop burns down, and the family goes further into debt. Rasheed searches for work elsewhere but has trouble. The family comes close to starvation. Mariam tries to reach Jalil for help, but she finds that he is dead.
Aziza is put into an orphanage so that she can be fed. Rasheed escorts Mariam, Laila, and Zalmai to visit Aziza, but their visits become less and less frequent. Eventually Rasheed refuses to go at all, so Laila risks the walk alone, often suffering beatings by the Taliban. Rasheed finds a job at a hotel and can sustain the family again.
One day after visiting Aziza at the orphanage, Laila sees Tariq standing at the front door of Rasheed's house. Laila is ecstatic. She weeps and hugs Tariq. Tariq and Laila visit together over the next few days, and Tariq describes his past. He went through a refugee camp, both of his parents died, and he spent time in prison. He became a hotel janitor. Laila tells Tariq about Aziza and her marriage to Rasheed, and Tariq does not blame her for marrying.
Zalmai is unhappy about the visits. He tells Rasheed that Laila has allowed Tariq to see her face, and Rasheed becomes enraged. Rasheed beats Laila and tries to suffocate her. He comes to succeeding, but Mariam hits him twice with a shovel, killing him.
After Rasheed's death, Laila is determined to leave Kabul. She asks Mariam to come with her and Tariq to Pakistan, but Mariam refuses. If Mariam were to leave, the Taliban would search for both of them to find the murderer, but Mariam cannot let the children live in such danger. She also could not look at Zalmai every day knowing she had killed his father. Laila and Zalmai pick up Aziza and leave town. They never see Mariam again.
Mariam eventually is caught and put into a prison run by the Taliban. She tries to explain that she was defending herself when she killed Rasheed, but the judge sentences Mariam to death. She is publicly executed.
Laila and Tariq marry and start a new life in Pakistan. They work for the same hotel at which Tariq worked before, and they live in a shack behind the hotel. Laila reveals to Aziza that Tariq is her father, and they bond instantly. Zalmai is at first adverse to Tariq, but he warms up.
After the terrorist attacks on the United States in 2001 and the onset of President George Bush's “War on Terror,” which has toppled the Taliban, Laila hears that conditions in Kabul are improving. She wishes to return and contribute. Tariq agrees.
Laila stops in Herat first and visits Mullah Faizullah's son and the kolba. Mullah Faizullah's son gives Laila a box that Jalil left for Mariam. The box contains a letter apologizing and providing an update for Mariam. The box also contains cash in American dollars and a copy of Pinocchio on video.
Laila, Tariq, Aziza, and Zalmai move into a townhouse in Kabul. Laila teaches at the orphanage. Tariq works for an NGO (non-governmental organization) that fits land mine victims with prosthetic limbs. Laila always feels Mariam close to her heart. As the novel ends, Laila is pregnant with her third child—if it is a girl, she will be named Mariam.