tam eva manasa dhyayan
sva-dharmad virarama ha
tat-nimitta—caused by the sight of her; smara-vyaja—taking advantage of his thinking of her always; graha-grastah—being caught by an eclipse; vicetanah—having completely forgotten his real position; tam—her; eva—certainly; manasa—by the mind; dhyayan—meditating upon; sva-dharmat—from the regulative principles executed by a brahmana; virarama ha—he completely ceased.
In the same way that the sun and moon are eclipsed by a low planet, the brahmana 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 brahmana.
By speaking this verse, Sukadeva Gosvami wants to impress upon the mind of the reader that Ajamilaís exalted position as a brahmana 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 Narayana, he was saved from the gravest danger of falling down. Svalpam apy asya dharmasya trayate mahato bhayat: 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 brahmana 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-gita it is advised that one not forget the chanting of the holy name even for a moment (satatam kirtayanto mam yatantas ca drdha-vratah [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 Krsna maha-mantra, he will be safe without a doubt.
Link to this page: https://prabhupadabooks.com/sb/6/1/63