Srimad Bhagavatam Canto 06, Chapter 01, Text 63

SB 6.1.63

tan-nimitta-smara-vyaja-
 graha-grasto vicetanah
tam eva manasa dhyayan
 sva-dharmad virarama ha
 
Translation by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada: 
 
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.
 
Purport by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada: 
 
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). 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.
Srimad Bhagavatam Canto 06, Chapter 01, Text 62
Srimad Bhagavatam Canto 06, Chapter 01, Text 64