During the reign of Philip V of Macedon (r. 221-179 BC), the Macedonians not only lost the Cretan War (205-200 BC) to an alliance led by Rhodes, but their erstwhile alliance with Hannibal of Carthage also entangled them in the First and Second Macedonian War with ancient Rome. The perceived weakness of Macedonia in the aftermath of these conflicts encouraged Antiochus III the Great of the Seleucid Empire to invade mainland Greece, yet his defeat by the Romans at Thermopylae in 191 BC and Magnesia in 190 BC secured Rome's position as the leading military power in the region. Within roughly two decades after conquering Macedonia in 168 BC and Epirus in 167 BC, the Romans would eventually control the whole of Greece.