The killing of Guru Vishwarupa by Indra, the king of devas, is an important incident found in the Puranas.
The Guru of Devas was Brihaspati. But once he had an
altercation with Indra, the king of Devas, and Brihaspati abandoned the Devas.
Without a proper Guru to guide, Devas faced several reversals.
Finally, on the advice of Brahma, Vishwarupa was appointed as the Guru of Devas.
Vishwarupa to impress Indra, gave him Shiva Kavach, with
which he defeated the demons (asuras).
Vishwarupa was born of the union of a Deva (Tvashta) and an
Asura woman (Rachna). He had deep love and affection for his mother and this
made him a supporter of the Asuras.
So whenever he performed a yajna for the Devas, in his mind
he prayed for the welfare of the Asuras.
Soon Asuras became powerful and Devas grew weaker.
Soon Indra realized the treachery of their newly appointed
Guru and in a fit of rage; he beheaded Vishwarupa in his ashram.