As told in the narration given to King Yudhishthira in the Mahabharata, Vritra was a demon created by artisan god Tvashta to avenge the killing of his son by Indra, known as Triśiras or Viśvarūpa. Vritra won the battle and swallowed Indra, but the other gods forced him to vomit Indra out. The battle continued and Indra was eventually forced to flee. Vishnu and the rishis (sages) brokered a truce, with Indra swearing that he would not attack Vritra with anything made of metal, wood or stone, nor anything that was dry or wet, or during the day or the night. Indra used the foam (which Vishnu had entered to ensure victory) from the waves of the ocean to kill him at twilight.