Magwitch explains to Pip that he has come to give him his full inheritance as thanks for his help on the marshes years before. He tells Pip about the other convict, a man named Compeyson. Pip later learns from Herbert that Compeyson was the same man who broke Miss Havisham's heart. Pip decides he will take no more of Magwitch's money. However, he feels responsible for the danger the man is in and will find a way to get him safely out of the country.
Pip is crushed to hear that Bentley Drummle is to marry Estella. Pip visits with her and Miss Havisham and pleads with her not to do this. He professes his deep love, which she cannot fathom, and tells her that he would be happy if she married another as long as it was not Drummle. During this conversation, Estella and Miss Havisham have an argument that shows she cannot love Miss Havisham, either. Miss Havisham realizes the depth of the damage she has done and is heartbroken.
Returning to London, Pip learns from Wemmick that Compeyson is watching Magwitch. Herbert and Pip hide Magwitch and devise an escape plan. Pip also gets an anonymous note to come to the marshes where someone has information about Magwitch. He returns home and visits Miss Havisham before going to the marshes. She begs his forgiveness and agrees to Pip's request to help fund Herbert Pocket's new business. Pip starts to leave then returns to see Miss Havisham's dress on fire. He saves her but she is very ill afterward. He goes to the marshes, where he is captured by Orlick, who intends to kill him. Rescue comes from Herbert and Startop who had followed him from London. Trabb's shop boy led them to the marshes.
They return to London and carry out their escape plan with Magwitch, but Compeyson has informed the authorities and they are caught. Compeyson and Magwitch struggle and fall into the river. Compeyson drowns and Magwitch is hurt, then imprisoned and sentenced to die. Pip by now has figured out Magwitch is Estella's father. He visits and cares for Magwitch until the man dies in prison. Afterward, Pip attends Wemmick's wedding. Pip also gets very sick and is himself arrested for not paying his debts. Joe comes and nurses Pip back to health and tells him Miss Havisham has died, leaving a large amount of money to Mr. Matthew Pocket. Before returning to his forge, Joe also pays off Pip's debt. Pip goes home, intending to make amends with Joe and marry Biddy. He arrives just in time to celebrate Joe and Biddy's wedding. Pip leaves shortly afterward for eleven years in Cairo, working with Herbert in his business. When he returns, he visits with Joe and Biddy and meets their son, little Pip. He also meets with Estella. She is a widow now after years in an abusive marriage to Drummle. She and Pip part, but the implication is that this time they will be together.