Shams-ud-Din Shah Mir () was a ruler of Kashmir and founder of the Shah Mir dynasty. Shah Mir is believed to have come to Kashmir during the rule of Suhadeva (), where he rose to prominence. After the death of Suhadeva and his brother Udayanadeva, Shah Mir proposed for marriage to Kota Rani, she refused and continued her rule for five months till 1339 and appointed Bhutta Bhikshana as prime minister. After the death of Kota Rani, Shah Mir established his own kingship, founding the Shah Mir dynasty in 1339, which lasted till 1561. Origin There are two theories regarding Shah Mir's origin. Some Persian chronicles of Kashmir describe Shah Mir as a descendant of the rulers of Swat. Historian A. Q. Rafiqi thinks it more likely that he was a descendant of Persian or Turkic immigrants to Swat. It has also been suggested that he belonged to a Sufi or Qadiri family. Some scholars state that the Panjgabbar valley, the location described by Jonaraja, was actually peopled by Khasas and so ascribe a Khasa ethnicity to Shah Mir. Most modern historians accept the Swati origins of Shah Mir. Kashmiri scholar N. K. Zutshi, having critically examined the sources, reconciles the two versions by noting that the Persian chronicles mentions Swadgir rather than Swat, which he interprets as Swadgabar, meaning "suburbs of Gabar", which coincides with Jonaraja's description of Panchagahvara-Simani (on the borders of Panchagagvara). A. Q. Rafiqi states: Career Early Service During the reign of Suhadeva, a Tatar chief by the name of Zulju invaded Kashmir and ravaged it. Suhadeva fled the country and his general Ramachandra occupied the throne. In the confusion Rinchan (), sought the aid of various generals, including Shah Mir, and caused an internal uprising, seizing the throne. He married Kota Rani, the daughter of Ramachandra. Rinchan embraced Islam at the hands of the ascetic, Bulbul Shah, and took the Muslim name of Sultan Sadruddin. He was later attacked by rebels, and was badly wounded, dying in 1323 A.D. Just before his death Sultan Sadruddin summoned his trusted minister, Shah Mir, who had since then risen to some prominence, and put his son, Haider, and wife, Kota Rani, in his care. After the death of Sadruddin, Kota Rani married Udayanadeva, the brother of Suhadeva. However he was a weak ruler, so nearly all duties associated with governance fell on Kota Rani. During and After the