Ma Chao later joins forces with Zhang Lu to attack Cao Cao, but fails to make any significant gains. Zhang Lu, who distrusts Ma Chao, sends Yang Bo to spy on Ma, but Yang Bo is later killed. Ma Chao then helps Liu Zhang, the governor of Yi Province, deal with an invasion on Yi Province by Liu Bei. He duels with Liu Bei's sworn brother, Zhang Fei, at the Battle of Jiameng Pass. Later, he is convinced by Li Hui to defect to Liu Bei, who accepts him and makes him a general. He fights for Liu Bei in the Hanzhong Campaign and is later posted to Xiping, where he defends Liu Bei's strongholds from the Xianbei chieftain Kebineng.