In the Mahabharatha, Ekalavya is introduced as a young prince of the lowly Nishadha tribes. Ekalavya was born to Devashrava (brother of Vasudeva, who was father of Krishna) and was raised by Hiranyadhanus, the leader (King) of the Nishadhas, who was a commander in the army of Jarasandha (the king of Magadha).
Desirous of learning advanced skills of archery, he seeks the tutelage of Drona, the legendary weaponsmaster of and instructor of Arjuna and his brothers. Drona, however, rejects Ekalavya on account of the prince's humble origins.
Ekalavya is undeterred and goes off into the forest where he fashions a clay image of Drona. Worshipping the statue as his preceptor, he begins a disciplined program of self-study. As a result, Ekalavya becomes an archer of exceptional prowess, superior even to Drona's best pupil, Arjuna. One day while Ekalavya is practicing, he hears a dog barking. Before the dog can shut up or get out of the way, Ekalavya fires seven arrows in rapid succession to fill the dog's mouth without injuring it. The Pandava princes come upon the "stuffed" dog, and wonder who could have pulled off such a feat of archery. Searching the forest, they find a dark-skinned man dressed all in black, his body besmeared with filth and his hair in matted locks. It is Ekalavya, who introduces himself to them as a pupil of Drona.
Arjuna fears that Ekalavya may have eclipsed him in skill with the bow. As a result, Arjuna complains to his teacher Drona, reminding Drona of his promise that he would allow no other pupil to be the equal of Arjuna. Drona acknowledges Arjuna's claim, and goes with the princes to seek out Ekalavya. He finds Ekalavya, as always, diligently practicing archery. Seeing Drona, Ekalavya prostrates himself and clasps the teacher's hands, awaiting his order.
Drona asks Ekalavya for a dakshina or deed of gratitude that a student owes his teacher upon the completion of his training. Ekalavya replies that there is nothing he would not give his teacher. Drona cruelly asks for Ekalavya's right thumb, knowing that its loss will hamper Ekalavya's ability to pursue archery. Ekalavya, however, cheerfully and without hesitation severs his thumb and hands it to Drona. For his part, Arjuna is relieved to find that the crippled Ekalavya can no longer shoot with his former skill and facility.
Later, Ekalavya worked as a confidant of King Jarasandh. At the time of Rukmini's Swayamvar, he acted as the messenger between Shishupala and Rukmini's father Bhishmaka, at Jarasandh's behest. Bhishmaka decides that Rukmini should marry Shishupala, but instead Rukmini elopes with Krishna. Ekalavya is later killed by Krishna, who hurls a rock against him, in a conflict against Jarasandh's army.