Rome's preoccupation with its war with Carthage provided an opportunity for Philip V of the kingdom of Macedonia, located in the north of the Greek peninsula, to attempt to extend his power westward.