Canto 2 -
Ayodhyā-kāṇḍa
Chapter 64: Daśaratha Gives up his Life in Remembrance of Lord Rāma
Text 2.64.57

अज्ञानात्तु हतो यस्मात्क्षत्रियेण त्वया मुनिः।
तस्मात्त्वां नाविशत्याशु ब्रह्महत्या नराधिप॥

ajñānāt tu hato yasmāt kṣatriyeṇa tvayā muniḥ
tasmāt tvāṁ nāviśaty āśu brahma-hatyā narādhipa

ajñānāt tu = unknowingly; hataḥ = have killed; yasmāt = because; kṣatriyeṇa = as a kṣatriya; tvayā = you; muniḥ = a sage; tasmāt1 tvām = you; na = not; āviśati = will enter; āśu = quickly; brahma-hatyā = the sinful reaction due to killing a brāhmaṇa; nara-adhipa = O king.

O king, because you as a kṣatriya have quickly killed a sage unknowingly, the sinful reaction due to killing a brāhmaṇa will not enter you.

NOTE. From this it is clear that the young ascetic was a brāhmaṇa by guṇa and karma.

The varṇas are ultimately determined not by birth (janma), but by guṇa and karma. This is explicitly noted in Śrīmad-Bhāgavatam 7.11.35:

yasya yal lakṣaṇaṁ proktaṁ puṁso varṇābhivyañjakam
yad anyatrāpi dṛśyeta tat tenaiva vinirdiśet

“If one shows the symptoms of being a brāhmaṇa, kṣatriya, vaiśya or śūdra, as described above, even if he has appeared in a different class, he should be accepted according to those symptoms of classification.”

Śrīla Prabhupāda has commented on this verse as follows:

Herein it is clearly stated by Nārada Muni that one should not be accepted as a brāhmaṇa, kṣatriya, vaiśya or śūdra according to birth, for although this is going on now, it is not accepted by the śāstras. As stated in Bhagavad-gītā (4.13), cātur-varṇyaṁ mayā sṛṣṭaṁ guṇa-karma-vibhāgaśaḥ. Thus the four divisions of society — brāhmaṇa, kṣatriya, vaiśya and śūdra — are to be ascertained according to qualities and activities. If one was born in a brāhmaṇa family and has acquired the brahminical qualifications, he is to be accepted as a brāhmaṇa; otherwise, he should be considered a brahma-bandhu. Similarly, if a śūdra acquires the qualities of a brāhmaṇa, although he was born in a śūdra family, he is not a śūdra; because he has developed the qualities of a brāhmaṇa, he should be accepted as a brāhmaṇa. The Kṛṣṇa consciousness movement is meant to develop these brahminical qualities. Regardless of the community in which one was born, if one develops the qualities of a brāhmaṇa he should be accepted as a brāhmaṇa, and he then may be offered the order of sannyāsa. Unless one is qualified in terms of the brahminical symptoms, one cannot take sannyāsa. In designating a person, a brāhmaṇa, kṣatriya, vaiśya or śūdra, birth is not the essential symptom. This understanding is very important. Herein Nārada Muni distinctly says that one may be accepted according to the caste of his birth if he has the corresponding qualifications, but otherwise he should not. One who has attained the qualifications of a brāhmaṇa, regardless of where he was born, should be accepted as a brāhmaṇa. Similarly, if one has developed the qualities of a śūdra or a caṇḍāla, regardless of where he was born, he should be accepted in terms of those symptoms.

1 Technical note: yasmāt tasmāt.