田令孜
Li Yan was born on June 8, 862, at the eastern palace in the Tang imperial capital Chang'an, as the fifth son of then-reigning Emperor Yizong. His mother was Emperor Yizong's concubine Consort Wang, who carried the title of "Guifei", the highest rank carried by imperial consorts. In 865, Li Yan was created the Prince of Pu; at that time, his older brother Li Kan () was created the Prince of Ying. Consort Wang died a year later, in 866. As he was growing up, one of his constant companions was the eunuch Tian Lingzi, who attended to the stables at his mansion.