Pagai is originally the port city of Megara, located on the Corinthian Gulf. Only very meager remains of the ancient city have been preserved on a hill near present-day Alepochori, especially some parts of the city wall. The city of Athens occupied Pagai in 461 BC. and then used the city as a base for its operations in the Corinthian Gulf during the First Peloponnesian War. Under the peace treaty of 446 between Athens and Sparta, the Athenians had to return the city to Megara. From that moment Pagai fell (with a short interval in 420 BC) under Megara, in 193 BC. to join the Achaean League as an independent city. The city was abandoned in Turkish times.