Harisimhadeva

Harisimhadeva (also called Hari Singh Deva) was a King of the Karnat dynasty who ruled the Mithila region of modern-day North Bihar in India and parts of South Nepal.
He reigned from 1304 to 1324. He was the last king to belong to the Karnata dynasty of Mithila. His minister of war and peace was Caṇḍeśvara Ṭhakkura who composed the famous treatise, the Rajanitiratnakara.
His reign came to an end after an invasion by Ghiyasuddin Tughlaq forced him to move to the hills of Nepal. His descendants eventually became the founders of the Malla dynasty of Kathmandu who were known for being patrons of the Maithili language.
Rule.
The reign of Harisimhadeva was considered a landmark point in the history of Mithila with many events taking place during his four decade reign. He introduced many social changes such as the four-class system for Maithil Brahmins and developed the Panji system. The scholars that thronged his courts left a permanent imprint on Mithila. 
Inscriptions detail that the Karnats of Mithila under Harisimhadeva had several battles with invading Muslim kings and were victorious in many instances but were eventually defeated.
Retreat to Nepal.
Mithila/Tirhut was stormed by the forces of Ghiyasuddin Tughlaq with Caṇḍeśvara Ṭhakkura describing the event as "the earth being flooded by mlecchas" despite the Karnatas scoring some victories previously. After his victory, Tughlaq handed over charge of the administration to the native people. Prior to this event, the Karnatas had already claimed sovereignty over certain parts of Nepal but were now forced to retreat deeper into the country in Kathmandu. Nepalese sources identify the introduction of the Goddess Taleju to Harisimhadeva. Historians disagree as to the exact date when he entered Nepal but all sources agree that he ended up retiring to the hills. He was succeeded by his son, Jagatsimha who was a member of the "highest nobility of the land". Jagatsimha ended up marrying Nayadevi and became the ruler of Bhaktapur.
His descendants eventually founded the Malla dynasty which ruled Kathmandu and the surrounding areas for roughly 300 years. The Mallas installed Maithili as the language of the elites.
A branch of the Karnatas is also theorised to have stayed in Mithila and they eventually became the Gandhavariya Rajputs of North Bihar. Evidence also shows that other descendants of Harisimhadeva's including a King Prithvisimhadeva were continuing to rule in Champaran district of Bihar into the 15th century.