In classical antiquity, Laconia was regarded as the property of the city-state of Sparta, after the surrounding cities had been subjected after the foundation of Sparta by the Dorians. In the early 8th century, the ancient city-state of Amyklai was first annexed, after which the Spartan king Teleklos soon subjugated the rest of Laconia. The original population was hereby reduced to second-class citizenship as perioikoi, with the primary duty to follow the Spartan kings in their continuing military actions, but without voting rights in the popular assembly or heliaia. In the second half of the 8th century, the Spartans conquered neighboring Messenia in a 20-year lasting war. The territory of the Messenians was divided into 9000 more or less equal parts and allotted to the Spartan citizens, while the Messenians themselves were forced to work these lands as helots (in fact a kind of serfs) and to give half of their income to their masters. This freed the Spartans from the need to work their fields themselves and allowed them to focus entirely on military service, with the men spending almost their entire working lives in military service (and the barracks). The professional army that was created in this way dominated all its opponents for almost the entire classical period, and led to the hegemony of Sparta in the Peloponnese. The establishment of the Peloponnesian League, with allies such as Corinth, Megara, Elis under the leadership of the Spartans, gave the Spartans even more power, which ultimately led to victory in the disastrous Peloponnesian War against the city of Athens, which was equally expansive. For a part of the 4th century B.C. Sparta was the factual captain of Greece, until the Boiotic Thebes under General Epameinondas managed to defeat the Spartans militarily, and to remove Messenia and Arcadia from Spartan influence by founding the heavily fortified cities of Messene and Megalopolis. The liberation of the perioikoi-towns and the establishment of a League of Free Laconians finally ended the Spartan rule of Laconia itself.