During Emperor An's reign, those close to him, including the eunuchs Jiang Jing (江京) and Li Run (李閏) and his wet nurse Wang Sheng (王聖), as well as his wife Empress Yan Ji, effectively ran the imperial administration, and used the opportunity to seize power and wealth for themselves. In 124, Jiang and Empress Yan accused the nine-year-old Crown Prince Liu Bao (劉保) of crimes and persuaded Emperor An to demote him to Prince of Jiyin.
In 125, Emperor An died suddenly, and even though Prince Bao was Emperor An's only son, Empress Yan, evidently wanting someone younger she could control, made Liu Yi (劉懿), the Marquess of Beixiang, emperor.
When the young emperor became gravely ill later in the year, Sun, who was then a mid-level eunuch, became concerned that Empress Dowager Yan would again bypass Prince Bao, the rightful heir, and so he entered into a conspiracy with a number of other eunuchs. They swore an oath to restore Prince Bao, and several days after the former Marquess of Beixiang died, they made a sudden assault on the palace and proclaimed Bao as Emperor Shun. After several days of battling with the empress dowager's faction, the eunuchs led by Sun prevailed, and the Yan clan was slaughtered.
For their contributions to his restoration, Emperor Shun created Sun and 18 of his fellow eunuchs marquesses.
Emperor Shun, whose temperament was weak, quickly fell under the control of the officials around him. In 126, when the eunuch Zhang Fang (張防) was accused of corruption by the governor of the capital district, Yu Xu (虞詡), he instead convinced the emperor that the accusations were false and that Yu should be sentenced to death. Sun and Zhang Xian (張賢), another eunuch who had helped put the emperor on the throne, interceded at great personal risk. Yu was spared, while Zhang was exiled. However, officials who were close to Zhang then accused Sun and his fellow eunuch-marquesses of being overly arrogant. Emperor Shun therefore sent them out of the capital Luoyang, to their estates. Sun, angered by this, had his marquess seal and emblems returned to the emperor and secretly stayed in the capital, looking to find another chance to try to guide the emperor onto the right path. He was soon captured, but Emperor Shun, remembering his accomplishments, simply sent him back to his estate without further punishment, but also without listening to his advice on stamping out corruption.
In 128, Emperor Shun, remembering what Sun and the others had done for him, summoned them back to the capital, but largely again ignored their advice. In 132, Sun died and was buried with great honors, including the posthumous name Gang (剛, literally "unbending").