tām eva manasā dhyāyan
sva-dharmād virarāma ha
tat-nimitta—caused by the sight of her; smara-vyāja—taking advantage of his thinking of her always; graha-grastaḥ—being caught by an eclipse; vicetanaḥ—having completely forgotten his real position; tām—her; eva—certainly; manasā—by the mind; dhyāyan—meditating upon; sva-dharmāt—from the regulative principles executed by a brāhmaṇa; virarāma ha—he completely ceased.
In the same way that the sun and moon are eclipsed by a low planet, the brāhmaṇa lost all his good sense. Taking advantage of this situation, he always thought of the prostitute, and within a short time he took her as a servant in his house and abandoned all the regulative principles of a brāhmaṇa.
By speaking this verse, Śukadeva Gosvāmī wants to impress upon the mind of the reader that Ajāmila’s exalted position as a brāhmaṇa was vanquished by his association with the prostitute, so much so that he forgot all his brahminical activities. Nevertheless, at the end of his life, by chanting the four syllables of the name Nārāyaṇa, he was saved from the gravest danger of falling down. Svalpam apy asya dharmasya trāyate mahato bhayāt: even a little devotional service can save one from the greatest danger. Devotional service, which begins with chanting of the holy name of the Lord, is so powerful that even if one falls down from the exalted position of a brāhmaṇa through sexual indulgence, he can be saved from all calamities if he somehow or other chants the holy name of the Lord. This is the extraordinary power of the Lord’s holy name. Therefore in Bhagavad-gītā it is advised that one not forget the chanting of the holy name even for a moment (satataṁ kīrtayanto māṁ yatantaś ca dṛḍha-vratāḥ [Bg. 9.14]). There are so many dangers in this material world that one may fall down from an exalted position at any time. Yet if one keeps himself always pure and steady by chanting the Hare Kṛṣṇa mahā-mantra, he will be safe without a doubt.
Link to this page: https://prabhupadabooks.com/sb/6/1/63