Southern Han was founded by the brothers Liu Yin and Liu Yan. Liu Yin's father, Liu Qian, was the regional inspector of Fengzhou. When he died, Liu Yin succeeded his post, and was made jiedushi of Qinghai in 905. When the Tang dynasty collapsed in 907, the Liu brothers took in refugees from the north and used them to establish an independent realm. Liu Yin died in 911 and his brother succeeded him. Liu Yan proclaimed the Great Yue in 917, but then changed the name to Han a year later. Southern Han invaded Annan in 930 and removed the Khúc clan from power. The Southern Han general Liang Kezhen raided Champa's capital, Indrapura, but the Southern Han themselves were defeated by Dương Đình Nghệ a year later. In 937, Kiều Công Tiễn killed Dương Đình Nghệ and called Southern Han into a war against rebels to the south, however Đình Nghệ's son-in-law Ngô Quyền murdered Công Tiễn and defeated the Southern Han fleet at the "Battle of Bạch Đằng" in 938. In 948, Southern Han invaded Ma Chu, taking 10 prefectures. During the reign of Liu Chang (958–971), the court was dominated by eunuchs, and the state fell into decline. The Southern Han army kept a permanent corps of war elephants. When the Song dynasty invaded in 970, their crossbowmen readily routed the Southern Han elephants. This was the last time elephants were used in Chinese warfare. In 971, Liu Chang surrendered to the Song dynasty. The state of Southern Han was characterized by a civilian government that organized state examinations to recruit officials, but it also taxed its common folks harshly to build palace complexes such as the Zhaoyang Hall with its golden roof.