Contrary to his older brother who was described as so developmentally disabled that he was unable to speak, clothe himself, or express whether he was hungry or full, Sima Dewen was described as an intelligent child.
Despite Sima Dezong's severe up developmental disability, he was made crown prince in 387 at the age of five by Emperor Xiaowu.
Huan Xuan established a new state of Chu, and he created Emperor An the Prince of Pinggu (平固王) and Sima Dewen the Duke of Shiyang[6] (石阳县公), but kept them close to him to watch them.
In 404, however, a rebellion by the general Liu Yu quickly led to Huan Xuan's destruction and Emperor An's restoration.
As the years went by, Liu Yu gradually concentrated more and more power in his hands, destroying rivals including Liu Yi (劉毅), Zhuge Zhangmin (諸葛長民), and Sima Xiuzhi (司馬休之), while greatly showing his strength in campaigns destroying rival states Southern Yan, Western Shu, and Later Qin.
However, around the new year 419, Sima Dewen was ill and had to be at his own house, and Liu Yu's assassin Wang Shaozhi (王韶之) took the opportunity to kill Emperor An.
In spring 420, Liu Yu, then at Shouyang sent his assistant Fu Liang to Jiankang to pressure Emperor Gong to yield the throne.
Emperor Gong responded by summoning Liu Yu back to the capital in summer 419, and Fu then offered him a draft of an abdication edict, requesting that he write it personally.
He had the general Liu Zunkao (劉遵考), a distant cousin, lead a group of guards, ostensibly to protect the prince but instead to keep him under watch.
As for the title of "Prince of Lingling", it remained in the Sima clan until it was abolished by Emperor Wu of Liang in April 502, when he ascended the throne.