The emergence of more advanced states and intensified competition between them spurred on the development of advanced galleys with multiple banks of rowers. During the middle of the first millennium BC, the Mediterranean powers developed successively larger and more complex vessels, the most advanced being the classical trireme with up to 170 rowers. Triremes fought several important engagements in the naval battles of the Greco-Persian Wars (502–449 BC) and the Peloponnesian War (431–404 BC), including the Battle of Aegospotami in 405 BC, which sealed the defeat of Athens by Sparta and its allies. The trireme was an advanced ship that was expensive to build and to maintain due its large crew. By the 5th century, advanced war galleys had been developed that required sizable states with an advanced economy to build and maintain. It was associated with the latest in warship technology around the 4th century BC and could only be employed by an advanced state with an advanced economy and administration. They required considerable skill to row and oarsmen were mostly free citizens who had years of experience at the oar.