During the fifth century BC the whole of Euboea became part of the Delian League, which later became the Athenian Empire. Eretria and other cities of Euboea rebelled unsuccessfully against Athens in 446 BC. During the Peloponnesian War Eretria was an Athenian ally against her Dorian rivals Sparta and Corinth. But soon the Eretrians, along with the rest of the Empire, found Athenian domination oppressive. When the Spartans defeated the Athenians at the Battle of Eretria in 411 BC, the Euboean cities all rebelled. After her eventual defeat by Sparta in 404 BC, Athens soon recovered and re-established her hegemony over Euboea, which was an essential source of grain for the urban population. The Eretrians rebelled again in 349 BC and this time the Athenians could not recover control. In 343 BC supporters of Philip II of Macedon gained control of the city, but the Athenians under Demosthenes recaptured it in 341 BC. The Battle of Chaeronea in 338 BC, in which Philip defeated the combined armies of the Greeks, marked the end of the Greek cities as independent states. However, under Macedonian rule Eretria experienced a new period of prosperity which lasted until the 3rd century as attested by many inscriptions, by extensions to the west and south sections of the walls and by many other private and public new buildings including the circus. From 318-312BC King Cassander lived at Eretria and commissioned the painter Philoxenus of Eretria to paint the battle of Issus, of which the famous Alexander Mosaic in the Naples museum is a copy and the wall paintings in Phillip's tomb at Vergina are connected. From 304BC Demetrius I granted the city partial autonomy. During this time the city was governed by who founded the Eretrian school of philosophy. After the Chremonidean War (267-262BC) a permanent Macedonian garrison was installed. In 198 BC in the Second Macedonian War Eretria was plundered by the Romans. The admiral Lucius Quinctius Flamininus was joined by the allied fleets of Attalus I of Pergamon and of Rhodes, and used them in besieging Eretria. He eventually took the town during a night-time assault during which the citizens surrendered. Flamininus came away with a large collection of art works as his share of the booty.