In Hindu mythology, the Rakshasas were depicted as monsters and the traditional enemies of the gods. In that way, Gatotkacha can be termed as a half rakshasa, as in the Hindu epic Mahabharata, he was born to the rakshasi or demoness Hidimba and Bhima, the second Pandava.
It is described in Mahabharata that after they escaped the Lakshagraha or the Yatugriha death trap at Varnavrata, the Pandavas trekked northwards into the forest during their days of exile. After wandering throughout the day for food, the tired Pandavas, along with their mother Kunti, slept on the forest floor at the nightfall, while Bhima remained sleepless, to guard and keep watching for the safety.
In the same forest lived Hidimb, a notorious and powerful rakshas, with his sister Hidimba. As the cannibalistic Hidimb sensed the smell of human flesh from a far off distance, he went to inspect the situation, and on his return asked his sister to take the form of a beautiful maiden to lure Bhima out of the group so that he could devour the others without any problem. According to the plan, Hidimba took the form of a beautiful girl and proceeded to seduce Bhima, and instantly fell in love with him. She approached Bhima, explained to him the intention of his monster brother, and begged him to marry her. Meanwhile, Hidimb grew impatient and appeared on the spot, and as he sensed the intention of his sister, he attacked Bhima. In the ensuing fight, they let out roars and uprooted the trees, and finally, Bhima whirled Hidimb and threw him on the ground, ending his life.
In the meantime, Kunti and her other sons appeared on the site, as they woke up due to the commotion. After the end of the great fight when they were about to leave the place, Hidimba fell at Kunti’s feet and conveyed her desire to marry Bhima. As Hidimba’s tearful begging melted the heart of Kunti, she asked Bhima to marry Hidimba and Bhima had to agree as he cannot disobey his mother. But he made a condition that he would leave her once she bore a child with him. In a year, Hidimba gave birth to a son, and Bhima joined the other Pandavas who were staying in the nearby forest and then proceeded southwards, while Ghatotkacha lived with his mother. Before they left, Hidimba promised that her son would always make his presence to help the Pandavas, if and when needed.
The child grew up with his mother in the forest Himbavana and was named Gatotkacha as he was bald, and his head was shaped like a Ghatam, a typical clay pot with a narrow mouth. Gradually, he grew up to become immensely powerful and learned to wield the mace, like his father, and became a master of magic and illusion, with the ability to grow to the size of mountains. He was even given a boon by Lord Krishna, that no one would be able to match him at magic and sorcery, except for Lord Krishna himself.
When Gatotkacha was summoned by Bhima to fight for the Pandavas during the Kurukshetra War, he wreaked havoc in the enemy Kaurava camp by using his magical powers, even scaring away great warriors like Duryodhana and Karna. However, after the death of Jayadratha, the husband of Dushala, the only sister of the Kaurava brothers, on the fourteenth day, when the battle continued past sunset, Gatotkacha truly shined as his powers grew immensely, and he caused even more havoc in the enemy camp.
As nobody could stop Gatotkacha from his killing spree and all the kings and the combatants fighting for the Kauravas started to fly in fear, it seemed that Gatotkacha is invincible and the war would be over soon. Finding no other way, Duryodhana requested his best friend, the great warrior Karna, to kill Ghatotkach, at any cost, and save the situation. Eventually, a great fight took place between Karna and Ghatotkacha, and when Karna found that all his efforts against the gigantic monster turn futile, he had no other option but to use his most powerful weapon called Indrastra, granted to him by Lord Indra, which can kill anybody but could be used only once. Although Karna preserved the deadly weapon to kill his arch enemy Arjuna, he had to use it on Ghatotkacha to save the Kauravas. The moment, when Karna hurled his fatal weapon and Ghatotkacha saw it flying toward him, he knew that his end is near. To make his final attack against the enemies of Pandavas, he increased into the size of a mountain, and when the arrow struck him, he fell crushing hundreds and thousands of Kaurava soldiers under his huge body.
By sacrificing his life Ghatotkacha proved his ultimate devotion to his father, and also played a significant role in turning the events of the Kurukshetra War in favour of the Pandavas. To kill him, Karna had to use the god gifted unfailing weapon that he preserved to kill Arjuna. As the weapon could not be used more than once, and it was already used to kill Gatotkacha, Karna lost his upper hand over his arch-enemy, and that made Arjuna invincible, which ultimately enabled Pandavas to win over the Kauravas.