As with most ancient civilizations, Rome's military served the triple purposes of securing its borders, exploiting peripheral areas through measures such as imposing tribute on conquered peoples, and maintaining internal order. From the outset, Rome's military typified this pattern and the majority of Rome's wars were characterized by one of two types. The first is the foreign war, normally begun as a counter-offensive or defense of an ally. The second is the civil war, which plagued the Roman Republic in its final century. Roman armies were not invincible, despite their formidable reputation and host of victories. Over the centuries the Romans "produced their share of incompetents" who led Roman armies into catastrophic defeats. Nevertheless, it was generally the fate of the greatest of Rome's enemies, such as Pyrrhus and Hannibal, to win early battles but lose the war. The history of Rome's campaigning is, if nothing else, a history of obstinate persistence overcoming appalling losses.