The story of the Hero twins begins with the death of their father, Hun-Hunahpu, who was sacrificed by the Lords of the Underworld for failing to pass their tests. The head of Hun-Hunaphu was placed on a tree and one day Xquic approached the tree and Hun-Hunahpu spat into her hand. The saliva caused Xquic to become pregnant with, and give birth to the Hero Twins, Hunahpu and Xbalanque.
The young Hero Twins met a rat, who told them about their father being a great ballplayer, and where to find their old ball equipment. As the boys started to play, the Lords of The Underworld summoned the twins to Xibalba to play a ballgame with them. Fearing for them, their grandmother relayed a message by telling a louse, hidden in a toad’s mouth, inside a snake that was in a falcon. The Hero Twins used some tricks to help them. They had a mosquito bite the the Lords of the Underword to learn which were real. When they entered the throne room, the Lords tried to trick the them by offering them a seat on a cooking grill. When the Hero Twins did not to sit down, they challenged them to a series of ordeals.
At the Dark House they had to keep a torch and two cigars lit throughout the night. They tricked the Lords using fireflies and the feathers of a macaw to make it seem like they were lit. After this, they were tricked into playing a ball game with a razor ball before going into the Razor House. Passing these tests, they went on to the Jaguar House, the Fire House, and then the Bat House.
In the Bat House, Hunahpu had his head cut off and the Lords used Hunahpu’s head for a ball instead. Xbalanque fashioned Hunahpu a new head using a gourd then tricked the lords by throwing the gourd head into a rabbit hole which gave Xbalanque enough time to put Hunahpu’s head back on his body and win the ballgame. The Lords tried to trick them one more time, but the Hero Twins jumped into the flames and their ashes were spread in the river. The Hero Twins were reincarnated as catfish, and then traveled through the underworld as beggars performing tricks of reincarnation - sacrificing animals and then bringing them back to life, eventually performing the tricks on themselves.
The Lords of Death summoned these beggars to perform the tricks for their amusement. They asked the Hero Twins to perform the trick on them. The Hero Twins sacrificed the Lords but tricked them by not bringing them back to life thus defeating the Lords of Death. The Hero Twins took the remains of Hun-Hunahpu and left the underworld - ascending into the sky and became the sun and moon.