On the way, she stops by an inn owned by the Thenardiers and decides to pay them a monthly allowance for taking care of Cosette. Unknown to Fantine, the Thenardiers end up resenting Cosette; abusing and neglecting her and finally treating her like a slave.
She ends up working for a jet work factory in M-sur-m, which gives her enough money to send to the Thenardiers. Her co-workers soon find out about her bastard child and she gets fired. She sells everything she has, including her teeth, and had to turn to prostitution to make ends meet.
The police inspector of the town is a man by the name of Javert, who used to work in Toulon. His duty is to the law, and he has no sympathy for those who do not uphold it. He arrests Fantine after she attacked a group of people who were ridiculing her. Madeleine refuses to let Javert throw her in prison, because he empathizes with her. He promises to reunite her with Cosette when she becomes ill.
Another man has been accused of being Jean Valjean, and Madeleine goes to court to prove that he is actually the convict, Jean Valjean. After the hearing, Valjean returns to the ailing Fantine to keep his promise. Javert interrupts this encounter and Fantine gets so upset that she dies. Valjean vows to take care of Cosette and is then thrown into jail. He escapes, but is recaptured while Napoleon was in power. Instead of going back to prison, the king made him do hard labor. He works aboard a ship where he saves a worker, but then throws himself overboard to make it look like he had drowned.
Valjean, now age 55, finds the 8-year-old Cosette while she was sent out in the middle of the night to get water for a patron of the inn. She was horribly abused, and was barely wearing rags. He spends the night at the Thenardiers and claiming to be her grandfather, pays 1500 francs for Cosette and takes her to Paris. Fearing that he will be discovered, they barely go outside.