After Beowulf slays Grendel and Grendel's mother, he returns to Geatland (modern day Sweden). His lord, Hygelac, and Hygelac's son eventually die, leaving the crown to Beowulf. After ruling for five decades, a slave awakens a dragon and steals some of the dragon's treasure. Angered at this, the dragon attacks the Geats. Rather than risk more lives, Beowulf endeavors to fight the dragon himself. However, Beowulf is accompanied by some of his soldiers. When they face the dragon, all the soldiers flee except Wiglaf. Together, Wiglaf and Beowulf slay the dragon, but Beowulf is mortally wounded in the fight.
The epic ends with Beowulf's funeral. Wiglaf and Beowulf's company go to Earnaness, which is the headland where Beowulf fought the dragon. They push the dragon over the cliff into the sea. They make a glorious funeral pyre for Beowulf, adding treasure from the dragon's lair. They mourn the loss of their king and fear that foreign armies might attack when they learn that their great leader has died:
Sad in spirit they lamented their heart-care, the death of their liege lord. [And the Geatish woman, wavy-haired, sang a sorrowful song about Beowulf, said] again and again that she sorely feared for herself the invasion of armies, many slaughters, terror of troops, humiliation, and captivity. Heaven swallowed the smoke.
Lastly, they build a monument for Beowulf surrounding the remains of the funeral pyre.