The war was a four-year-long politico-military struggle, fought in Italy, Illyria, Greece, Egypt, Africa, and Hispania. Pompey defeated Caesar in 48 BC at the Battle of Dyrrhachium, but was himself defeated much more decisively at the Battle of Pharsalus. The Optimates under Marcus Junius Brutus and Cicero surrendered after the battle, while others, including those under Cato the Younger and Metellus Scipio fought on. Pompey fled to Egypt and was killed upon arrival. Scipio was defeated in 46 BC at the Battle of Thapsus in North Africa. He and Cato committed suicide shortly after the battle. The following year, Caesar defeated the last of the Optimates under his former lieutenant Labienus in the Battle of Munda and became "Dictator perpetuo" (Dictator in perpetuity or Dictator for life) of Rome. The changes to Roman government concomitant to the war mostly eliminated the political traditions of the Roman Republic (509–27 BC) and led to the Roman Empire (27 BC–AD 476).