Tang Xuanzong, named Li longji, is also known as Tang Minghuang. Li longji, a man of competence, was the grandson of Empress Wu Zetian, the only female monarch in China's history. When he was young, Li Longji with his aunt Princess Taiping, daughter of Wu Zetian, started a coup and helped his father to ascend the throne, from whom he succeeded the throne. He was later named as Tang Xuanzong and changed the reign to Kai Yuan.
At the beginning of his rule, Tang Xuanzong's abilities in poetry, arts and martial arts were one of the best in the country. Because of his political talents and quick reaction, he managed to prevent Princess Taiping from usurping the throne, putting the princess together with her henchmen to death. Ever since then, Tang Xuanzong's kaiserdom was stabilized and the country entered a 40-year-odd prosperity, which is recorded as the the Prosperity of Kai Yuan Period.
Kai Yuan was the title of first 20 years of Xuanzong's reign. From the "Prosperity of Zhenguan" of Tang Taizong's reign to the end of Kai Yuan Period, the social economy saw the peak of prosperity after a hundred years' development. The capital, Chang'an, became the richest and most populous city in the world.
The Tang Empire presented a scene of general prosperity in which people lived and worked in such peace and contentment that no one would take any articles left by the wayside and doors were not bolted at night. Furthermore, political, economic and cultural contacts between the Tang Empire and foreign countries became more and more frequent. Diplomatic envoys, merchants, scholars, artists, monks and priests from Asia, Europe and Africa came to visit the Tang Empire constantly. Besides, the Tang army reoccupied lost territories from surrounding minority groups and resumed sovereignty over the Western Region.
However, the splendid appearance covered up the depravity. By the eighth century, during the later part of Tang Xuanzong's reign, the Tang Empire was in decline.
During the later years of his reign, the Tian Bao Period, Tang Xuanzong became more and more lordly and extravagant. He doted upon his Yang Guifei (Concubine Yang) and spent all his time in search of pleasure and neglected the court as well as politics. He foolishly appointed fraudulent and treacherous people such as Li Linfu and Yang Guozhong (Yang Guifei's cousin) as his ministers. This resulted in the political corruption, which became a potential crisis at his court. Ever since then, Tang Xuangzong Tang thus walked on its road to destruction.
During Xuanzong's later years, the government started to corrupt and the famous "The Treason of Anshi" occurred. In 755AD, An Lushan, taking advantage of Tang's corruption, rose against the government, in an attempt to take it down. The treacherous army soon sacked big cities Luo Yang and Chang'an. Tang Xuanzong escaped to Cheng Du. But the army wouldn't advance in the middle because Yang Guifei's cousin -- the prime minister -- had connections with the traitors. Because of the hatred the soldiers had towards Yang Guifei, even after the death of her brother, they still wouldn't advance. Xuanzong had no choice but to watch his favorite woman kill herself at the slopes of Mawei village.
After Tang Xuanzong escaped to Cheng Du, his son, the crown prince, succeeded the throne at Lin Wu and became Tang Suzong (Emperor Suzong). Tang Suzong ordered generals Guo Ziyi and Li Guangbi to counterattack the treacherous army. They successfully retrieved Chang'an and Luo Yang. In 763, the treacherous army was finally defeated for good, but this war lasted for 8 years and severely weakened the power of the government. The Tang Dynasty thus walked on a path of destruction.
Tang Xuanzong, however, never recovered from his loss of Yang Guifei, and died a broken man a few years later. He was buried in Tai Mausoleum.