Agni, Indra, Vayu and Yajna made a sacrifice. The four agreed that each would receive an equal share. Yajna received the first gift. He fled with it from the sacrificial site. The others followed him. But Yajna was faster, unhooked them and took a nap in a forest, resting his head on his bow.
When Agni, Indra and Vayu found him, they decided to behead him, but who should do it? They asked the ants of the forest to gnaw through the bowstring. They refused. The three offered them a share of the sacrifice. The ants gnawed the bowstring, freed from the tension of the bowstring, the bow separated Yajna’s head from the body.
The head flew into the sky and became a ball of fire, the sun. The Gods put a horse’s head on Yajna and Hayagriva was born.