Garden, the emperor could put He Jin under his own command. When Emperor Ling died in the early months of 189, the stage was set for a showdown between He Jin and the eunuch faction. Jian Shuo plotted to lure He Jin into a trap at the imperial palace where he would be assassinated. However, when He Jin arrived, a minor official Pan Yin () subtly warned He Jin about Jian Shuo's plot. Astonished, He Jin returned to his own camp and evaded the assassination attempt. Afterwards, He Jin had Jian Shuo arrested, executed, and then seized command of the troops previously under Jian Shuo's command. With the support of the elite Yuan family, particularly Yuan Shao and Yuan Shu, the succession dispute was resolved in favour of Liu Bian, the son of Empress He, who ascended the throne in the fifth month of that year. He Jin and his sister, now the Empress Dowager, jointly took on the role of regent. During the summer months, He Jin and his subordinates engaged the eunuch faction in court politics. The eunuchs, now without a military power base of their own, relied on the support of Empress Dowager He and He Miao. At the urging of Yuan Shao, He Jin summoned the general Dong Zhuo to the outskirts of Luoyang, in an attempt to force the Empress Dowager to back down. In the ninth month of that year, He Jin entered the palace to request the Empress Dowager agree to the execution of the eunuchs. Zhang Rang, the leader of the eunuch faction, discovered He Jin's plan through a spy who overheard the conversation between He Jin and the Empress Dowager. The eunuchs then lured He Jin into the imperial palace by summoning him in the name of the Empress Dowager. He Jin entered the palace unsuspectingly, without his escort, and met his end at the hands of the eunuchs. The situation soon spun out of control. Yuan Shao and Yuan Shu, both with significant control of military forces within the capital, stormed the palace and massacred the eunuchs. The resulting power vacuum allowed Dong Zhuo to seize control of the imperial court. As soon as he held supremacy over the capital, Dong Zhuo deposed the emperor in favour of the Prince of Chenliu, who came to be known as Emperor Xian. The deposition as well as Dong Zhuo's subsequent atrocities incurred