 During the Chremonidean War, in 266 BC, the Megarians were besieged by the Macedonian king Antigonus Gonatas and managed to defeat his elephants employing burning pigs.Despite this success, the Megarians had to submit to the Macedonians.In 243 BC, exhorted by Aratus of Sicyon, Megara expelled its Macedonian garrison and joined the Achaean League, but when the Achaeans lost control of the Isthmus in 223 BC the Megarians left them and joined the Boeotian League.