
Sima Bao was killed by his subordinates Yang Ci(楊次) and Zhang Chun in 320 over his disagreements (another source states he died naturally). Chen An threatened Shanggui again not long after, but once again withdrew due to Former Liang reinforcements. As Chen An encroached into Shanggui, Sima Bao fled to Nan'an (南安 southeast of present-day Longxi County, Gansu) but reinforcements from Former Liang pushed Chen An back to Mianzhu, so Sima Bao returned to his capital. In response, Chen An named himself Inspector of Qinzhou and formally submitted to both Han Zhao and Cheng Han. In 319, fulfilling his imperial ambition, Sima Bao declared himself the Prince of Jin. Chen An and Jiao Song carried on their assault into the following year in 318, when they were now threatening Sima Bao's capital of Shanggui.

Their invasion had a devastating effect, as a large portion of the Yongzhou and Qinzhou population was wiped out. He and another minor warlord named Jiao Song (焦嵩) invaded Sima Bao's territory in Longshi together with the Han general Liu Yao.

Shortly after, Chen An sided himself with Han Zhao. The attack never took place, as Han Pu's forces met with difficulties in marching into Han territory. In early 317, Former Liang forces led by Han Pu were preparing to launch a counter-attack against Han, and Chen An involved himself to serve as a vanguard. The Jin government in Chang'an fell to Han Zhao forces and Emperor Min of Jin was held captive in 316. There, Chen An established himself as an independent warlord, but he later sent a messenger informing Sima Bao that he would continuously send tribute to him. He sent an assassin to kill Chen An, but Chen was only wounded by the assassin's blade before he rode away to Longcheng. Although they agreed, Sima Bao could not bring himself to execute Chen An, so Zhang Chun took matters into his own hands. In 315, Zhang slandered Chen An and convinced Sima Bao that he would rebel at any given time. Ĭhen An's special treatment was not taken well by Chen An's colleague, Zhang Chun (張春).

During his time with Sima Bao, Chen An commanded a campaign to suppress the rebelling Qiang tribes in Qinzhou, and for this, Sima Bao showed him great courtesy and respect. As the disaster broke out, Sima Mo was captured and killed by Han Zhao forces, and Chen An decided to flee to his son, Sima Bao, who was the Inspector of Qinzhou at the time.
