The story begins with the village of St. Petersburg in deep mourning, believing the children lost forever. This sorrow is abruptly shattered when a "wild peal" from the village bells announces the miraculous news: "They're found!" Tom Sawyer, exhausted from "three days and nights of toil and hunger," recounts his harrowing ordeal to Aunt Polly and the gathered crowd. He describes his desperate search for an exit, navigating passages guided only by a "kite line" until he glimpsed a "far-off speck that looked like daylight"—the open air near the Mississippi River.
However, the relief is short-lived. During a conversation with Judge Thacker, Tom learns that the Judge has "had its big door covered with sheet iron" and "triple locked" the cave to prevent further accidents. Upon hearing this, Tom turns "as white as the sheet," realizing the horrific implication: "Injun Joe's in the cave." The subsequent search confirms the tragic fate of the antagonist, who had "starved to death" while trapped behind the locked door.
Following the recovery, Tom and Huck Finn turn their attention to the missing treasure. While Huck assumes the money is a "goner" because Injun Joe’s room at the inn was empty, Tom remains convinced that the loot is still inside the cave. The boys journey back to the river, with Tom locating the "snuggest hole" he had discovered during his escape.
Driven by a desire to form "Tom Sawyer's gang" and become a "robber," the boys venture deep into the dark tunnels. The journey is fraught with memories for Tom, who points out the "fragment of candle wick" where he and Becky had watched their light die. As they press further, they reach the spot where Tom had previously seen Injun Joe. Tom directs Huck to look for a "cross" marked with "candle smoke" on a big rock. Their intuition proves correct; digging just "four inches" down, they strike wood and unearth the treasure box. As Huck runs his hands through the "old coins," they realize the magnitude of their discovery: "We're rich!"
After securing the gold, the boys plan to hide it in the loft of the widow's woodshed. Their plans are interrupted by the Welshman, who insists they accompany him to a gathering at the Widow Douglas's home. The boys arrive looking disheveled, "covered in clay, mud and candle grease," much to the embarrassment of Aunt Polly, who "blushed crimson" at their appearance.
The widow, however, welcomes them with open arms, proving her affection for the boys despite their rough state. She provides them with new clothes, insisting they "wash and dress" before joining the prominent guests downstairs. This final scene marks a transition for the boys, as they move from the grime and danger of the cave into a world of social acceptance, carrying the secret of their newfound fortune that will undoubtedly change their lives forever.