Emperor Huan becomes increasingly disgruntled at Liang Ji's control of the government as the years pass, and is also angered by Empress Liang's behavior.
Because of her position as Empress Dowager Liang and Liang Ji's sister, Empress Liang is wasteful in her luxurious living, far exceeding any past empress, and is exceedingly jealous.
She does not have a son, and because she does not want any other imperial consorts to have sons, if one becomes pregnant, Empress Liang finds some way to murder her.
Emperor Huan does not dare to react to her due to Liang Ji's power, but rarely has sexual relations with her.
Angry and depressed that she has lost her husband's favor, Empress Liang dies in 159, initiating a chain of events that lead to Liang Ji's downfall.
Liang, in order to continue to control Emperor Huan, has adopted his wife's beautiful cousin Deng Mengnü (the stepdaughter of her uncle Liang Ji (written with a different Chinese character despite the same pronunciation), as his own daughter, changing her family name to Liang.
He and Sun give Liang Mengnü to Emperor Huan as an imperial consort, and, after Empress Liang's death, they hope that she will be eventually created empress.
To completely control her, Liang Ji plans to have her mother, Lady Xuan , killed, and in fact sends assassins against her, but the assassination is foiled by the powerful eunuch Yuan She, a neighbor of Lady Xuan.
Lady Xuan reports the assassination attempt to Emperor Huan, who is greatly angered.
He enters into a conspiracy with eunuchs Tang Heng, Zuo Guan, Dan Chao, Xu Huang, and Ju Yuan to overthrow Liang—sealing the oath by biting open Dan's arm and swearing by his blood.
Liang Ji has some suspicions about what Emperor Huan and the eunuchs are up to, and investigates.
The five eunuchs quickly react.
They have Emperor Huan openly announce that he is taking back power from Liang Ji and mobilize the imperial guards to defend the palace against a counterattack by Liang.
They then surround Liang's house and force him to surrender.
Liang and Sun, unable to respond with any force, commit suicide.
The entire Liang and Sun clans (except for Liang Ji's brothers Li Buyi and Liang Meng, who had previously already died) are arrested and slaughtered.
A large number of officials are executed or deposed for close association with Liang—so many that the government is almost unable to function for some time.
Liang and Sun's properties are confiscated by the imperial treasury, which allows the government to reduce taxes.
After Liang Ji's death, Emperor Huan creates Liang Mengnü empress, but dislikes her family name, and therefore orders her to take the family name Bo.
Later, he discovers that her original family name was actually Deng, and therefore has her family name restored.
The people have great expectations for Emperor Huan's administration after the death of Liang Ji.
However, having been able to overthrow Liang Ji with the five eunuchs' help, Emperor Huan greatly rewards them, creating them and several other eunuchs who had participated in the coup d'état marquesses and further gives them governmental posts that confer tremendous power.
Further, the five eunuch-marquesses openly engage in massive corruption and become extremely wealthy, with Emperor Huan's approval.
Emperor Huan himself is also corrupt and unwilling to accept any criticism.
In 159, when the honest county magistrate Li Yun submits a petition urging him to curb the power of the eunuchs, Emperor Huan is deeply offended that he has included the phrase, "Is the emperor turning blind?"
and, despite intercessions by a number of officials and even some fair-minded eunuchs, has Li and his friend Du Zhong both executed.