He was specifically called out as the warrior who forced Karna to use his Vasavi Shakti weapon, and courted a hero’s death in the great war.
While they were sleeping, the demon chief Hidimba in the forest sees the Pandavas from the top of a tree, and he appoints his sister Hidimbi to bring them to him for food.
According to non canonic folktales, years later, one day Hidimbi asks Ghatotkacha to fetch a human to sacrifice to Kali.
Scolded by Bhima, both Ghatotkacha and Hidimbi agree to end the practice of human sacrifice.
On the 8th day of battle, Ghatotkacha has a prolonged clash with Alambusha, and though he manages to severely wound the other demon, he is unable to prevent his retreat.
Ashwatthama attempts to rally fleeing soldiers, dispelling Ghatotkacha's illusion and managing to knock the demon unconscious.
During the fight, both combatants use their magical powers and celestial weapons, though Ashwatthama manages to hold his ground and forces Ghatotkacha to withdraw.
After the death of Jayadratha on Day 14, with the battle continuing past sunset, Ghatotkacha truly shines; his powers were at their most effective at night as demons' abilities are heightened.
As the army breaks around him, with even Duryodhana forced to flee with his flag in tatters, Karna uses Vasavi Śhakti as a last resort to ultimately kill the powerful demon.
[7] Though mortally wounded by the weapon Vasavi Śakti, Ghatotkacha rises to the sky and manages to enlarge his body, crushing one akshauhini of the Kaurava army.
The story was adapted and developed from the script Kakawin Bharatayuddha written in 1157 during the time of the Kediri Kingdom (present day East Java, Indonesia).
In the wayang puppet version, Ghatotkacha (locally spelled 'Gatotkaca') is very close to his cousin named Abhimanyu, son of Arjuna.
Ghatotkacha actually scolded Kalabendana, which he considered presumptuously interfering in his cousin's household affairs.
Ghatotkacha was deliberately chosen because Kotang Antrakusuma armor which he wears is able to emit bright light to shine on Kaurava's army.
But the spirit of Kalabendana suddenly appeared to catch Kontawijaya while delivering news from heaven that the death of Ghatotkacha had been set that night.
The weapon merges back into its sheath, which is the mastaba wood still stored in Ghatotkacha's gut.
Ghatotkacha dies, and the spirit of Kalabendana threw his body towards Karna who managed to jump to escape death.
The existence of Barbarika is debated as he is mentioned in the later additions to the Skanda Purana, and not in the official renditions of the Mahabharata.