The agōgē was the rigorous education and training program mandated for all male Spartan citizens, except for the firstborn son in the ruling houses, Eurypontid and Agiad. The training involved cultivating loyalty to the Spartan group, military training (e.g., pain tolerance), hunting, dancing, singing, and social (communicating) preparation. The word "agoge" meant rearing in ancient Greek, but in this context generally meant leading, guidance, or training.

According to folklore, agoge was introduced by the semi-mythical Spartan law-giver Lycurgus but its origins are thought to be between the 7th and 6th centuries BC when the state trained male citizens from the ages of seven to twenty-one.

The aim of the system was to produce strong and capable warriors to serve in the Spartan army. It encouraged conformity and the importance of the Spartan state over one's personal interest and generated the future elites of Sparta. The men would become the "walls of Sparta" because Sparta was the only Greek city with no defensive walls after they had been demolished at the order of Lycurgus. Discipline was strict and the males were encouraged to fight amongst themselves to determine the strongest member of the group.

More Info: en.wikipedia.org