After admitting to being the convict, Valjean returned to Fantine's bedside, where he was confronted by Javert. After hearing Javert cry out Madeleine's true identity and the fact that her daughter was not present, Fantine lost her will to live and died of her illness. Valjean surrendered to Javert, but swiftly escaped to rescue Cosette, Fantine's daughter.
After successfully rescuing Cosette, Valjean was offered shelter in a convent by Fauchelevant, an old man who he had rescued from beneath his cart while he was mayor. After smuggling Valjean in initially, he later had to smuggle him out in a coffin for him to stay officially. Valjean stayed in the convent with Cosette as his own daughter.