The city of Rome originated as a village of the Latini in the 9th century BC. It was initially ruled by kings, but the Roman Republic was established in 509 BC. During the 5th century BC, Rome gained regional dominance in Latium, and eventually the entire Italian peninsula by the 3rd century BC. The population of the city at this point is estimated at about 310,000 people.
With the Punic Wars, Rome gained dominance over the Western Mediterranean, displacing Carthage as the dominant regional power. The Roman Empire was established under Octavian in 27 BC, after Julius Caesar's conquest of Gaul, followed by a period of civil war. The city of Rome now surpassed a population of one million, likely the first city in history to reach this size (compared to world population of about 200–300 million at the time).
At the peak of Roman imperial power in the 2nd century, the population of the city numbered about a million people, a size that it never attained again until its becoming the capital of the Republic of Italy in 1946; close to three percent of the population of the empire lived within its limits. Following the Crisis of the Third Century and the transfer of the imperial capital to Constantinople in AD 330, Rome entered a period of gradual decline.