Early career Xiahou Ba's parents were important figures in Cao Wei; his father,
Xiahou Yuan, had fought alongside his distant cousin and founder of Wei,
Cao Cao, since the start of the civil war, and was one of the most trusted of Cao's generals, while Xiahou Ba's mother was a sister-in-law of Cao Cao. After Xiahou Yuan was killed at
Battle of Mount Dingjun in 219 at the hands of Shu general,
Huang Zhong, most of his troops were placed under the command of
Zhang He upon advice from
Guo Huai, while his private militia and guards were succeeded by his five sons. Xiahou Ba displayed great hatred for Shu, and vowed revenge for his father. In 220, Xiahou Yuan's eldest son
Xiahou Heng was given his own marquisate and marquis title, so Xiahou Ba inherited his father's marquis title with a stipend of tax revenues from 800 taxable households.
Mid career In 230, when the Wei general
Cao Zhen proposed a shift from defensive to offensive stance against Shu Han, Lieutenant-General (偏将军) Xiahou Ba was named as the vanguard. He then led a force towards
Hanzhong Commandery taking a route through the 330 km Ziwu Trail (子午道), and camped in a crooked gorge, near the Xingshi camp set up earlier by Shu general,
Wei Yan. There, Xiahou Ba was identified by the local residents, who reported his presence to the Shu forces, and was under heavy attack. As the main army of Cao Zhen had not caught up with the vanguard, Xiahou Ba was thrown into a grave situation, where he was forced to rely on personal skills to fight his enemies between barricades until Cao Zhen arrived. The two forces reached a stalemate and the standoff lasted for a few months, but the developments favoured the Shu side as continuous rainfall over a month had rendered narrow valleys impassable, resulting in Wei army's logistical difficulty. In addition to the disadvantageous weather, Wei Yan had penetrated to the Wei army's rear and successfully incited some non-Han tribes to oppose the Wei forces, so Cao Zhen and Xiahou Ba begrudgingly decided to retreat. Since then, Xiahou Ba was appointed General of the Right, and stationed in Longxi Commandery to train troops; he personally cared for his soldiers and established friendly relation with the foreign tribes (
Xirong people) of the region hence he acquired their admiration.
As a trusted aide of Cao Shuang In the 240s, Xiahou Ba was enfeoffed as the Marquis of Bochang Village and became a close associate of
Cao Shuang, Cao Zhen's son and a regent to the Wei emperor
Cao Fang. When Cao Shuang decided to wage war against Shu to enhance his personal influence and reputation, Xiahou Ba was made Protector of the Army and came under command of
Xiahou Xuan, who was the marquis's son in the clan. For the ensuing campaign, however, the Wei general
Guo Huai, whom Xiahou Ba disliked, had the honour of leading the vanguard. This time, Wei forces chose the shorter Tangluo Trail into Shu territory, but again experienced logistic problems as a long section of the trail had no water source. As a result, the Wei forces had no choice but to retreat, and many soldiers merely died of thirst along the way back. After the war, Guo Huai, due to his timely withdrawal of troops, was granted a higher military authority over Xiahou Ba. From 244 to 249, Xiahou Ba played into the hands of Guo Huai, who wielded power to temporarily command him when a military crisis arose. In 247, when some tribal leaders rebelled against Wei, Xiahou Ba came under attack by the Shu general
Jiang Wei, who came to support the tribes. Together with Guo Huai, Xiahou Ba repelled Jiang Wei's attack and struck back at the rebels, forcing many of them to surrender. However, E Zhesai (蛾遮塞) of the Qiang tribes and Zhi Wudai (治无戴) of the Hu tribes still persevered, so the war was fragmented into battles that dragged on to 248, wherein Jiang Wei again led Shu forces to the aid of the rebels. At this point, it is clear that Guo Huai, instead of Xiahou Xuan, was the actual commander on the field to give out orders. For instance, when Guo Huai decided to attack Jiang Wei's subordinate,
Liao Hua, Xiahou Ba was ordered directly by the decision maker to tail Jiang Wei's main troop to the west. Upon knowing Liao Hua was under attack, Jiang Wei harshly returned to his aide's assistance just as Guo Huai predicted, isolating the rebels from Shu reinforcement. As the Shu commander was worn out from the travel, so was Xiahou Ba, but the glory and merit of subjugating the rebellion went to Guo Huai, who was promoted to a district marquis for his achievements. On the contrary, Xiahou Ba virtually received nothing for his effort in the campaign. ==Service under Shu==