When it finally comes time for Muff Potter's trial for murder, most people are ready to see justice served, while Tom and Huck, being the only ones that know Muff is innocent, are despairing. It seems hopeless for Muff, as his lawyer isn't making any effort to defend him.
Then the judge calls in the witness who just so happens to be Mr. Tom Sawyer. Tom, after questions are asked, reveals he was in the graveyard on June 17 at midnight, he was very close to Horse William's grave, and he was hidden behind the elms on the edge of the grave.
He begins to explain what had happened, and "--and as the doctor fetched the board around and Muff Potter fell, Injun Joe jumped with the knife and --"
Tom was interrupted because Injun Joe runs for the window because he knows that it would be unwise to stay, because he may be caught. Muff Potter is then taken to people's hearts.