In the 1840s, a mischievous boy named Tom Sawyer lives with his Aunt Polly and his half-brother, Sid, in the Mississippi River town of St. Petersburg, Missouri. After playing hooky from school on Friday and dirtying his clothes in a fight, Tom is made to whitewash the fence as punishment all of the next day. At first, Tom is disheartened by having to forfeit his day off. However, he soon cleverly persuades his friends to trade him small treasures for the privilege of doing his work. He trades the treasures he got by tricking his friends into whitewashing the fence for tickets given out in Sunday school for memorizing Bible verses, which can be used to claim a Bible as a prize. He received enough tickets to be given the Bible. However, in response to a question to show off his knowledge, he incorrectly answers that the first disciples were David and Goliath.Tom falls in love with Becky Thatcher, a new girl in town, and persuades her to get "engaged" by kissing him. Becky kisses Tom, but their romance collapses when she learns that Tom has been "engaged" previously, to a girl named Amy Lawrence. Shortly after being shunned by Becky, Tom accompanies Huckleberry Finn, the son of the town drunk, to the graveyard at night to try out a "cure" for warts with a dead cat. At the graveyard, they witness the murder of young Dr. Robinson by the Native-American "half-breed" Injun Joe. Scared, Tom and Huck run away and swear a blood oath not to tell anyone what they have seen. Injun Joe frames his companion, Muff Potter, a hapless drunk, for the crime. Potter is wrongfully arrested, and Tom's anxiety and guilt begin to grow.Tom, Huck, and Tom's friend run away to an island to become pirates. While enjoying their newfound freedom, the boys become aware that the community is sounding the river for their bodies. Tom sneaks back home one night to observe the commotion. After a brief moment of remorse at the suffering of his loved ones, Tom is struck by the idea of appearing at his funeral and surprising everyone.Back in school, Tom gets himself back in Becky's favor after he nobly accepts the blame for a book that she has ripped. Soon, Muff Potter's trial begins, and Tom, overcome by guilt, testifies against Injun Joe. Potter is acquitted, but Injun Joe flees the courtroom through a window. Tom then begins to fear for his life as Injun Joe is unapprehended and can easily find out where Tom is.Summer arrives, and Tom and Huck go hunting for buried treasure in a haunted house. After venturing upstairs they hear a noise below. Peering through holes in the floor, they see Injun Joe enter the house disguised as a deaf and mute Spaniard. He and his companion, an unkempt man, plan to bury some stolen treasure of their own. From their hiding spot, Tom and Huck wriggle with delight at the prospect of digging it up. Huck begins to shadow Injun Joe every night, watching for an opportunity to nab the gold. Meanwhile, Tom goes on a picnic to McDougal's Cave with Becky and their classmates. That same night, Huck sees Injun Joe and his partner making off with a box. He follows and overhears their plans to attack the Widow Douglas, a kind resident of St. Petersburg. By running to fetch help, Huck forestalls the violence and becomes an anonymous hero.A week later, Tom takes Huck to the cave and they find the box of gold, the proceeds of which are invested for them. The Widow Douglas adopts Huck, and, when Huck attempts to escape civilized life, Tom promises him that if he returns to the widow, he can join Tom's robber band. Reluctantly, Huck agrees. The Adventures of Huckleberry Finn is the book's sequel.