Over several centuries, Rome built a massive empire that controlled portions of three continents by the 2nd century AD. The Roman Republic was established in the 8th century BC, replacing a monarchy. Power was shared between two consuls, the Senate, and citizen assemblies. Through conquest over centuries, Rome came to dominate the Mediterranean, defeating Carthage in the Punic Wars. By the 1st century BC, the Roman Republic controlled territory from Spain to Anatolia.