In Hispania, the sons of Pompey, Gnaeus and Sextus, along with Caesar's former legate Titus Labienus had continued to resist Caesar's dominance of the Roman world. The loyalty of the local tribes was mixed, but the Republican forces had little difficulty in raising new armies. In total, the Pompeian forces had recruited 13 legions along with an additional 6,000 cavalry and other auxilia. Caesar arrived in 'Spain' in late November or early December of 46 BC, with 8 legions and 8,000 cavalry of his own. Caesar's arrival was completely unexpected by the enemy, and the surprise gave him an early advantage.
Over the next 3 months, both sides did what they could to secure various cities and the loyalty of local tribes. Various minor engagements, though brutal and bloody, took place over the winter months with neither side gaining a clear advantage. It was becoming evident that this was the last hope for the Republicans, as both armies willingly executed captives, and Caesar was uncharacteristically harsh. Near the city of Osuna, on the plains of Munda, Caesar's main force and that of Gnaeus Pompey met for an enormous climactic battle.
In March of 45 BC, the two armies faced off with Pompey holding the high ground, and Labienus commanding the cavalry wing. Caesar was forced to march uphill against the strong enemy position, but he was never one to shirk from a chance at open battle. As his army marched to meet Pompey, and the battle was joined, it soon became clear that this would be among the most ferociously fought battles of Caesar's career. Both armies seemed to sense the importance of what would be the final major battle of this long civil war. Neither army was able to gain an advantage and both sides likely shifted from moments of sheer panic to believing victory was imminent. The exhausting battle was taking its toll and both commanders left their strategic overview positions to join their men in the ranks. Caesar himself later told friends that he had fought many times for victory, but Munda was the first time he had fought for his life. Finally after an epic struggle, Caesar's 10th began to make the difference.
Positioned on Caesar's right wing, the 10th started to push back Pompey's wing. Pompey countered by moving forces from his more secure right wing to reinforce the precarious position on his left. Caesar, however, pressed his advantage and sent his cavalry hard against Pompey's now weakened right. Dio Cassius adds that Caesar's ally, King Bogud of Mauretania now came up and threatened Pompey's camp. Labienus, in command of Pompey's cavalry, recognized the threat and broke off from the main battle with his cavalry to secure the camp, but this seemed to have dire consequences. Pompey's men seemed to have viewed this as a general retreat by the one man who knew Caesar so well, and panic was the result. To this point, both sides had likely lost about 1,000 men each, a relatively high figure and indicative of the difficult fighting, but the actions of Labienus sent Pompey's army into all out fight. Caesar's army overwhelmed the retreating enemy and was merciless in its zeal to end the war. Up to 30,000 men were slaughtered in the carnage, including Labienus, but Gnaeus Pompey managed to escape. Still, it would turn out to be the final major battle and victory of Caesar's career, and one that effectively ended land based resistance.
Over the next few months, Caesar mopped up in Hispania and brutally punished the people for their disloyalty. Gnaeus Pompey was later killed and his brother Sextus who garrisoned Corduba managed to flee Spain entirely. He would later become a prominent pirate admiral, disrupting sea trade against both Antony and Octavian during the next civil war, but for now, he was reduced to a lucky survivor. During the mop up campaign, Caesar was joined by his nephew Octavian, and the young man probably secured himself as Caesar's heir during the campaign. He certainly learned a great deal about provincial administration from his now all-powerful uncle. This un-opposed power, however, began to have its effects on Caesar. By the time he returned to Rome in September of 45 BC, the rewards and honors heaped on him were irreversibly alienating him from the Senate and Roman elite. Conspiracy began to take root and the inevitable end was now only a few months away.