After the end of the Persian Wars, the Athenian-led Delian League and the Spartan-led Peloponnesian League often came into conflict, without declaring war outright. Sparta had been opposed to Athens rebuilding its walls, which had been destroyed by the Persians, and were opposed to Athens' plans to built the "Long Walls" to its port of Piraeus. Athens also suspected Sparta of secretly negotiating with factions in the city to undermine the democratic government. In 460 BC, another dispute arose with Corinth, an ally of Sparta. Corinth did not want Megara to built long walls to its port either, and Athens intervened in a separate border dispute.
In 457, Nicodemes of Sparta, regent for the underaged king Pleistoanax, marched an army of 11 500 hoplites into Boeotia to help Thebes put down a rebellion by Phocis. Athens took advantage of this to block the routes back to the Peloponnese, and Sparta decided to remain in Boeotia and await the Athenian attack. The Athenians and their allies, under the command of Myronides, had 14 000 men, and met the Spartans at Tanagra. Although the Spartans won the battle, they lost many men and were unable to follow up on their victory; their route home, however, was now open.
Two months later, the Athenians regrouped and defeated Thebes at the Battle of Oenophyta and took control of Boeotia.