The Pugyel Dynasty ruled Tibet after Namri Songtsen (Lontsen) defeated the Zingpo Lord. Namri Songtsen was later assassinated and his son, Songtsen Gampo, only a teenager, became king. Songtsen Gampowas credited with creating the Tibetan alphabet, adopting a legal code and introducing Buddhism to Tibet. During his time, the Jokhang and Ramoche temples of Lhasa were constructed, with central images supposedly brought from China by the Tang princess Wencheng. Though he was succeeded by his son, Mangsong Mangtsen, whose son Dusong followed on the throne, their reigns were overshadowed by the role of the powerful Gar clan. However, as Dusong matured, the influence of the Gar family waned when several of the influential Gar ministers were executed.