Great Expectations Chapter 56: He is Tried and Sentenced...
Magwitch lies in prison, nearly incapacitated with the broken ribs and punctured lung he suffered during the failed escape. Pip is a devoted visitor, and he holds Magwitch's hand when he comes to trial. As Pip had anticipated, his kind benefactor is found guilty, though in a spectacle he couldn't have imagined, he is sentenced to death along with a herd of thirty-two other prisoners.
There is little to do but wait for the execution day, though Pip does write a furious round of petitions, imploring for mercy on the man who was so kind to him. One day when Pip goes to the prison for a visit, it's clear that death is going to take Magwitch before the executioner can. Just before the old man dies, Pip whispers to him that his daughter Estella lives, and that he, Pip, is in love with her.