Empress Dowager Wu favored him greatly, and in order to facilitate his being able to come in and out of the palace, had him undertake tonsure to become a Buddhist monk with the name Huaiyi.
Because Huaiyi came from a lowly household, in order to elevate his status, Empress Dowager Wu had him adopted into the clan of her son-in-law Xue Shao (薛紹) (the husband of her daughter Princess Taiping) and had Xue Shao treat Huaiyi as an uncle.
She commissioned Huaiyi to oversee the project and conscripted several tens of thousands of men to serve as construction workers.
After the imperial meeting hall was completed later that year, for his contributions, she gave him a general title and created him the Duke of Liang.
In 694, Eastern Tujue's khan Ashina Mochuo attacked Ling Prefecture (靈州, roughly modern Yinchuan, Ningxia), and Wu Zetian commissioned Huaiyi, assisted by the chancellors Li Zhaode and Su Weidao, to defend against Ashina Mochuo's attack.
[3] Huaiyi's body was taken to White Horse Temple and cremated, and then mixed into mud that was set to be used to construct a pagoda.
A portrait of Huaiyi as supervillain appears in the quasi-historical novel Deception (also titled Iron Empress), by Eleanor Cooney and Daniel Altieri.