Śrīmad-Bhāgavatam · Text 8.12.31
Who is speaking and story frame
तस्यासौ पदवीं रुद्रो विष्णोरद्भुतकर्मण: । प्रत्यपद्यत कामेन वैरिणेव विनिर्जित: ॥ ३१ ॥
tasyāsau padavīṁ rudro
viṣṇor adbhuta-karmaṇaḥ
pratyapadyata kāmena
vairiṇeva vinirjitaḥ
As if harassed by an enemy in the form of lusty desires, Lord Śiva followed the path of Lord Viṣṇu, who acts very wonderfully and who had taken the form of Mohinī.
Read Śrīla Prabhupāda's purport on Vedabase.io