Srimad Bhagavatam Canto 09, Chapter 21, Text 21

SB 9.21.21

ajamidho dvimidhas ca
 purumidhas ca hastinah
ajamidhasya vamsyah syuh
 priyamedhadayo dvijah
 
Translation by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada: 
 
From King Hasti came three sons, named Ajamidha, Dvimidha and Purumidha. The descendants of Ajamidha, headed by Priyamedha, all achieved the position of brahmanas.
 
Purport by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada: 
 
This verse gives evidence confirming the statement of Bhagavad-gita that the orders of society — brahmana, ksatriya, vaisya and sudra — are calculated in terms of qualities and activities (guna-karma-vibhagasah). All the descendants of Ajamidha, who was a ksatriya, became brahmanas. This was certainly because of their qualities and activities. Similarly, sometimes the sons of brahmanas or ksatriyas become vaisyas (brahmana-vaisyatam gatah). When a ksatriya or brahmana adopts the occupation or duty of a vaisya (krsi-goraksya-vanijyam), he is certainly counted as a vaisya. On the other hand, if one is born a vaisya, by his activities he can become a brahmana. This is confirmed by Narada Muni. Yasya yal-laksanam proktam. The members of the varnas, or social orders — brahmana, ksatriya, vaisya and sudra — must be ascertained by their symptoms, not by birth. Birth is immaterial; quality is essential.
Srimad Bhagavatam Canto 09, Chapter 21, Text 19-20
Srimad Bhagavatam Canto 09, Chapter 21, Text 22