Śrīmad-Bhāgavatam · Text 4.6.40
Who is speaking and story frame
स तूपलभ्यागतमात्मयोनिं
सुरासुरेशैरभिवन्दिताङ्घ्रि: ।
उत्थाय चक्रे शिरसाभिवन्दन-
मर्हत्तम: कस्य यथैव विष्णु: ॥ ४० ॥
sa tūpalabhyāgatam ātma-yoniṁ
surāsureśair abhivanditāṅghriḥ
utthāya cakre śirasābhivandanam
arhattamaḥ kasya yathaiva viṣṇuḥ
Lord Śiva’s lotus feet were worshiped by both the demigods and demons, but still, in spite of his exalted position, as soon as he saw that Lord Brahmā was there among all the other demigods, he immediately stood up and offered him respect by bowing down and touching his lotus feet, just as Vāmanadeva offered His respectful obeisances to Kaśyapa Muni.
Read Śrīla Prabhupāda's purport on Vedabase.io