During Emperor Xuanzong's reign In 712, Emperor Ruizong passed the throne to Li Longji, who took the throne as Emperor Xuanzong. In 713, after Emperor Xuanzong converted Yong and Luo Prefectures to special municipalities, Song was made the mayor of Jingzhao Municipality (京兆府, i.e., the old Yong Prefecture). As of 715, he was serving as chief imperial censor (御史大夫, Yushi Daifu), when, on one occasion, he was accused of not ordering for greater force to be applied when a criminal was being caned, and he was demoted to be the prefect of Mu Prefecture (睦州, in modern Hangzhou). He was later made the commandant at Guang Prefecture (廣州, roughly modern Guangzhou, Guangdong). It was said that at that time, the people of Guang Prefecture used bamboo to build houses, and therefore the houses were prone to fires. Song promoted the use of bricks, which greatly reduced the damage of fires, and the people of the region were grateful for this. As of 716, Yao Yuanzhi—who had changed his name to Yao Chong by that point—and Lu Huaishen were serving as chancellors. Lu died in late 716, and before he did, submitted a petition arguing that Song and several other officials, Li Jie (), Li Chaoyin (), and Lu Chongyuan had been demoted only of minor offenses and, as they were talented, should be repromoted. Meanwhile, Yao was drawing displeasure from Emperor Xuanzong due to accusations that his sons and associate Zhao Hui () were corrupt. Yao, in fear, offered to resign and recommended Song to succeed him. Emperor Xuanzong, who was then preparing to go to Luoyang, thus recalled Song to serve as the minister of justice (刑部尚書, Xingbu Shangshu) and be in charge of Chang'an. He sent one of his close eunuch associates, Yang Sixu (), to Guang Prefecture to escort Song back to the capital. Yang had many past achievements—including putting down a coup during Emperor Zhongzong's reign led by Emperor Zhongzong's crown prince Li Chongjun—and was honored by the emperor, but on the trip back to Chang'an, Song, who did not like to ingratiate the emperor's associates, did not say anything to him. When Yang informed Emperor Xuanzong of this, Emperor Xuanzong was even more impressed with Song. Around the new year 717, he removed Yao and fellow chancellor Yuan Qianyao from their chancellor posts and replaced them with Song and Su Ting—naming Song Huangmen Jian (黃門監,