In 1219, Genghis Khan invited the Daoist sage Qiu Chuji for advice on "keeping the empire in good order." The 76-year old Qiu had previously declined invitations from the emperors of the Jin and Southern Song, but agreed to travel from Shandong to Yanjing and then to Central Asia, where, at the Mongol encampment in the Hindu Kush, he taught the Genghis Khan about the "Dao", telling the great khan medicine for immortality did not exist and urged him to preserve lives. The Mongol leader called Qiu an immortal sage, made him the head Daoist priest of the empire and exempted Daoism from taxation. Qiu returned to Yanjing in 1224 and expanded what would become the White Cloud Temple, where he is buried and which is today the seat of the Chinese Daoist Association. When Kublai Khan, the grandson of Genghis Khan, visited Yanjing in 1261, much of the city lay in ruin, so he stayed in the Daning Palace on Qionghua Island. Unlike other Mongol leaders who wanted to retain the traditional tribal confederation based in Karakorum in Outer Mongolia, Kublai Khan was eager to become the emperor of a cosmopolitan empire. He spent the next four years waging and winning a civil war against rival Mongol chieftains and in 1264 ordered advisor Liu Bingzhong to build his new capital at Yanjing. In 1260, he had already begun construction of his capital at Xanadu, some due north of Beijing on the Luan River in present-day Inner Mongolia, but he preferred the location of Beijing. With the North China Plain opening to the south and the steppes just beyond the mountain passes to the north, Beijing was an ideal midway point for Kublai Khan's new seat of power. In 1271, he declared the creation of the Yuan dynasty and named his capital Dadu (, Chinese for "Grand Capital", or "Daidu" to the Mongols). It is also known by the Mongol name Khanbaliq (), spelled "Cambuluc" in Marco Polo's account. Construction of Dadu began in 1267 and the first palace was finished the next year. The entire palace complex was completed in 1274 and the rest of the city by 1285. In 1279, when Mongol armies finished off the last of the Song dynasty in southern China, Beijing became for the first time, the capital of the whole of China. After the construction of Dadu, Xanadu, also known as Shangdu, became Kublai Khan's summer capital.