Born at
京口 to a poor family, he rose as an officer of the
北府兵, defeated the rebel
孙恩 and then
桓玄, who had seized the Jin throne, and led northern campaigns that in 417 took back the old capital
长安. In 420 he took the throne from the Jin as Emperor Wu of Song.