In the spring of 249, the Wei regent Cao Shuang was deposed and executed in a coup launched by his co-regent Sima Yi, who then held full control of the Wei government. Xiahou Ba was then a subordinate of Xiahou Xuan, who held the position of General Who Attacks the West (征西將軍). Xiahou Xuan was a relative of both Xiahou Ba and Cao Shuang. After Cao Shuang's death, Sima Yi summoned Xiahou Xuan back to the capital, Luoyang, and replaced him with Guo Huai. Guo Huai thus became Xiahou Ba's new commanding officer. Xiahou Ba had all along not been on good terms with Guo Huai, so he feared that he would end up like Cao Shuang, hence he fled and defected to Shu.