Ugrasena was the King of Mathura, a kingdom that was established after the various Yadava clans, which include the Vrishnis and Bhojas decided that the dividing states would unite as one and that the Kingship would not be subject to heredity (but could be) and if decided not to be so, the succeeding leader would be chosen by a simple majority, therefore, a semi-democracy was established. When the groups gathered, the uniting factions decided to throne Ugrasena as the king due to his skills in warfare and his humble nature towards domestic and foreign policy issues.
According to the Vayu Purana (96.134), Ugrasena belonged to the Kukura clan (Kukurodbhava). According to the Puranas, he was son of Ahuka. Ugrasena was married to Queen Padmavati and was the father of Kamsa and Rajimati who was to get married to Neminath but later got initiated as a nun in his holy order after his enlightenment. Due to the tremendous power of Kamsa, Ugrasena declared him as the crown prince of Mathura, therefore guaranteeing the succession of kingship after his retirement or death. Later on, Ugrasena also installed Kamsa as the army commander.
However, due to hostile behavior of Kamsa and his ruthless actions towards the military members and the citizens of Mathura, growing friction began to occur the two, which led to the serious thought of whether Kansa should be dethroned. However, before such action might take place and sensing change, Kamsa overthrew his father with the support of his father-in-law, King Jarasandha of Magadha and his immense military. After the coup, Kamsa imprisoned his father and kept him in the deepest pits of jail for a sustained time period.
After the death of Kamsa by the hands of Krishna, Ugrasena was installed the King of Mathura and ruled over the kingdom for a while. The crown prince under his second reign was Krishna's father, Vasudeva. During Ugrasena's reign, the sages Vishwamitra, Narada and Kanwa came to meet Krishna. The sons of Krishna decided to play a joke on the sages by disguising Samba as a pregnant woman and asked whether the child would be male or female. The sages who had occult vision came to know that they were playing a prank on them. The sages then cursed that Samba would deliver an iron rod which will annihlate the whole Yadava clan. As per the curse, Samba next day delivered an iron rod. The Yadavas gave news about this incident to Ugrasena who had the rod turned into powder and thrown into the sea. He also prohibited liquor in his kingdom. Sometime after this incident he died and attained heaven. He along with Bhurshiravas, Shalya, Uttara and his brother Shankha, Vasudeva, Bhuri, Kamsa joined the company of Devas in heaven.