Shalya was the King of Madra in the Mahabharata. Her sister Madri was married to Prince Pandu. He was the uncle of Nakula and Sahadeva – the last of the two Pandava brothers. In the Kurukshetra battle, he fought on the side of the Kauravas.
Legend has it that it was by cheating that Shalya was enticed to join the camp of Kauravas. As Shalya was approaching the Kurukshetra battlefield with his army, he found that, at each halting point, there were arrangements made for his comforts. Shalya thought it had been done by Yudhishtira.
After enjoying the comforts at several places, he sent a message through one of the men to go to his master and state that Shalya would serve that master who had accorded such treatment.
It was only later he realized that Duryodhana was that master. However, having given his word, he decided to keep it.
Shalya fought bravely for Duryodhana. When Karna became commander-in-chief, he was asked to serve as Karna’s charioteer. But throughout his charioteership he caused confusion in the mind of Karna. This created uncertainty and fear, which partly led to the death of Karna.
When Karna died, Shalya was made the commander-in-chief on the last day of the Mahabharat battle. He fought bravely and finally died at the hands of Yudhisthira.