The Pugyel Dynasty ruled Tibet after Namri Songtsen defeated the Zingpo Lord. Namri Songtsen was later assassinated and his son, Songtsen Gampo, only a teenager, became king. Songtsen Gampo was credited with sponsoring the creation of the Tibetan alphabet, adopting a legal code and introducing Buddhism to Tibet. During his time, the Jokhang and Ramoche temples of Lhasa were constructed. According to tradition, central images were 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.