The Supreme Lord, Viṣṇu, who sits in everyone’s heart, appearing as Yajñapati, observed that the Rākṣasas and demons were going to devour Svāyambhuva Manu. Thus the Lord, accompanied by His sons named the Yāmas and by all the other demigods, killed the demons and Rākṣasas. He then took the post of Indra and began to rule the heavenly kingdom.
Srimad Bhagavata Purana
श्रीमद्भागवतमहापुराणम्
मूल श्लोकः
तांस्तथावसितान् वीक्ष्य यज्ञः सर्वगतो हरिः । यामैः परिवृतो देवैर्हत्वाशासत्त्रिविष्टपम्
tāṃstathāvasitān vīkṣya yajñaḥ sarvagato hariḥ | yāmaiḥ parivṛto devairhatvāśāsattriviṣṭapam
SB 8.1.18