sa evam vartamano jno
mrtyu-kala upasthite
matim cakara tanaye
bale narayanahvaye
sahthat Ajamila; evamthus; vartamanahliving; ajnahfoolish; mrtyu-kalewhen the time of death; upasthitearrived; matim cakaraconcentrated his mind; tanayeon his son; balethe child; narayana-ahvayewhose name was Narayana.
When the time of death arrived for the foolish Ajamila, he began thinking exclusively of his son Narayana.
In the Second Canto of the Srimad-Bhagavatam (2.1.6) Sukadeva Gosvami says:
The highest perfection of human life, achieved either by complete knowledge of matter and spirit, by acquirement of mystic powers, or by perfect discharge of ones occupational duty, is to remember the Personality of Godhead at the end of life. Somehow or other, Ajamila consciously or unconsciously chanted the name of Narayana at the time of death (ante narayana-smrtih), and therefore he became all-perfect simply by concentrating his mind on the name of Narayana.
It may also be concluded that Ajamila, who was the son of a brahmana, was accustomed to worshiping Narayana in his youth because in every brahmanas house there is worship of the narayana-sila. This system is still present in India; in a rigid brahmanas house, there is narayana-seva, worship of Narayana. Therefore, although the contaminated Ajamila was calling for his son, by concentrating his mind on the holy name of Narayana he remembered the Narayana he had very faithfully worshiped in his youth.
In this regard Srila Sridhara Svami expressed his verdict as follows: etac ca tad-upalalanadi-sri-narayana-namoccarana-mahatmyena tad-bhaktir evabhud iti siddhantopayogitvenapi drastavyam. According to the bhakti-siddhanta, it is to be analyzed that because Ajamila constantly chanted his sons name, Narayana, he was elevated to the platform of bhakti, although he did not know it. Similarly, Srila Viraraghava Acarya gives this opinion: evam vartamanah sa dvijah mrtyu-kale upasthite satyajno narayanakhye putra eva matim cakara matim asaktam akarod ity arthah. Although at the time of death he was chanting the name of his son, he nevertheless concentrated his mind upon the holy name of Narayana. Srila Vijayadhvaja Tirtha gives a similar opinion:
Directly or indirectly, Ajamila factually remembered Narayana at the time of death (ante narayana-smrtih).

Link to this page: https://prabhupadabooks.com/sb/6/1/27

If you Love Me Distribute My Books -- Srila Prabhupada