In the Battle of Yamen on the Pearl River Delta in 1279, the Yuan army, led by the general Zhang Hongfan, finally crushed the Song resistance. The last remaining ruler, the 13-year-old emperor Emperor Huaizong of Song, committed suicide, along with Prime Minister Lu Xiufu and 1300 members of the royal clan. On Kublai's orders, carried out by his commander Bayan, the rest of the former imperial family of Song were unharmed; the deposed Emperor Gong was demoted, being given the title 'Duke of Ying', but was eventually exiled to Tibet where he took up a monastic life. The former emperor would eventually be forced to commit suicide under the orders of Kublai's great-great grandson, Gegeen Khan, out of fear that Emperor Gong would stage a coup to restore his reign. Other members of the Song Imperial Family continued to live in the Yuan dynasty, including Zhao Mengfu and Zhao Yong.