By July 47 BC Caesar was back in Rome, and was formally appointed dictator for the second time.
In Spain the legions were in mutiny. And in Africa the Pompeians were scoring victories.
He also found the legions in Campania in mutiny, demanding to be discharged. But what they really wanted was not a discharge, but more pay.
Caesar coolly complied with their demand, granting them their discharge together with a message of his contempt. Whereupon the distraught troops begged to be reinstated again, whatever his terms may be. A triumphant Caesar granted them their will and re-employed them.
Next Caesar carried a force to Africa, but was unable to strike a decisive blow until in February 46 BC he shattered the Pompeian forces at Thapsus. The senatorial leaders either fled to Spain or killed themselves, including Juba, king of Numidia who had sided with them. Numidia in turn was annexed and made a new Roman province.
Caesar returned to Rome and celebrated a series of triumphs. Having reconciliation in mind, he celebrated not his victories over other Romans, but those over the Gauls, Egypt, Pharnaces and Juba.
But more so he astonished the world by declaring a complete amnesty, taking no sort of revenge on any of his past enemies.
Confirmed as dictator for the third time, Caesar occupied himself with reorganizing the imperial system, legislating and planning and starting public works.
Then, for a last time, Caesar was called to deal with a Pompeian force. Two sons of Pompey, Gnaeus and Sextus, had, after fleeing from Africa been able to raise an army in Spain. Once in Spain, sickness kept Caesar inactive until the end of the year. But by 46 BC he moved on the Pompeians once more, and at the battle of Munda on 17 March 45 BC he finally crushed them, in his most desperately fought battle.
For six more months Caesar was occupied in the settlement of Spanish affairs, before in October 45 BC he returned to Rome.
Into the few months of his remaining regime Caesar compressed a surprising amount of social and economic legislation, most of all the granting of full Roman citizenship to all Italians.
It was in his many reforms and projects that it showed that Caesar was not merely a conqueror and destroyer. Caesar was a builder, a visionary statesman the likes of which, the world rarely gets to see.
He established order, begun measures to reduce congestion in Rome, draining large tracts of marshy lands, revised the tax laws of Asia and Sicily, resettled many Romans in new homes in the Roman provinces and reformed the calendar, which, with one slight adjustment, is the one in use today.