In the epic poem Beowulf, Beowulf engages in several battles with supernatural monsters: Grendel, Grendel's mother, and the dragon.
The battle against Grendel's mother contains an important instance of situational irony. Early in the poem Grendel's origins and ancestry are described by the poet:
Into a thousand forms of evil--spirits
And fiends, goblins, monsters, giants,
A brood forever opposing the Lord's
Will, and again and again defeated.
It is this reference to "giants" that is most interesting. Biblically, giants are said to have inhabited the earth in pre-history. This links the Beowulf story to Christianity and the Old Testament. But it also sets up a surprising development during the fight between Beowulf and Grendel's mother a little later in the story.
When Beowulf attacks Grendel's mother at the bottom of the mere, he finds the sword Hrunting (a gift from former rival Unferth) useless. Without a weapon he is in grave danger, having survived so far only because of his protective mail shirt. Then . . .
He saw, hanging on the wall, a heavy
Sword, hammered by giants, strong
And blessed with their magic, the best of all weapons
But so massive that no ordinary man could lift
Its carved and decorated length.
This is the weapon that saves Beowulf's life. Grendel's mother cannot overcome it's magical power and Beowulf uses it to decapitate her.
The irony here is that she is killed by a weapon created by her own evil ancestors. Beowulf was pretty much out of options at this point, and the unexpected appearance of a magic sword saves him at the last moment. We call this plot device "deus ex machina," which literally means "God from the machine." It refers to the last minute solutions and rescues we so often see in literature and movies. The ironic twist at the end is also still popular among modern readers and viewers.