Makardhwaja / Magardhwaja as per Hindu history, is son of Hanuman, who makes his appearance in various regional versions of the Ramayana.
Birth and thereafter
When Hanuman took a dip in the waters of the sea, a drop of his perspiration fell into the mouth of a mighty Makara. Out of this, Makardhwaja was born. According to another, slightly different version, when Hanuman took a dip in the sea, to cool himself after burningLanka; a drop of his sweat, due to the extreme heat generated in his body due to extreme labor by him, fell into the mouth of a giant fish-eat-reptile like creature, Makara, thus impregnating it. The fish was caught by people of Ahiravana, who ruled Patala, the nether-world. Markardhwaja was discovered when the stomach of the fish was cut open and thus he was named after it and was brought up by them. When he grew up, Ahiravana, seeing his strength and virility gave him job of guarding, the gates of his Kingdom.
According to Ramayana told by Valmiki, this story has no place in it. However, in local folk tales this story is related. When Ahiravana took Rama and Lakshmana to Patala, Hanuman followed them to their rescue. He was challenged at the gate of Patala by a creature, who was part Vanara and part reptile - a Makara. He introduced himself Makaradhwaja and son of Hanuman, the mighty warrior. Hanuman was amused and said that, I am myself the Hanuman but he could not be his son, as he was Poorna Brahmachari/lifelong celibate since birth. However, Hanuman then closed his eyes in dhyana to see the events described above of Makardhwaja's birth. Makardhwaja asked him for his blessings, however, he said to Hanuman, that he will have to fight him to enter Patala, as he cannot betray Ahiravana, his mentor. Hanuman defeats Makaradhwaja in a duel and then ties him to the back to proceed further to ultimately kill Ahiravana and rescue Rama & Lakshamana as Makardhawaja is presented as the exemplary devotee of Ahiravana as Hanuman for Rama. While returning from patal lok Shri Ram takes a glance at Makradhwaj in pain, post enquiring Hanumanji narrates the story to Shri Ram. Shri Ram being impressed by Makardhwajs stand for his mentor and fight with Hanumanji declares him the king of Patal Lok as then king Ahiravan was killed.
Lineage
The Jethwa clan of Kshatriyas claim their descent from Makardhwaja. As per folktales of their clan, Makardhwaja had a son named Mod-dhwaja and he had a son named Jethi-dhwaja. Jethwas claim descant from Jethi-dhwaja and worship Hanuman as their Iṣṭa-devatā. The Jethwa dynasty of Gujarat, who once ruled major part of Kathiawar and later the princely state of Porbandar, therefore, had the image of Hanuman on their royal flag.