The battle of Thespiae (378 BC) was a Theban victory that ended a period of Sparta raids from their base at Thespiae, and in which the Spartan commander Phoebidas was killed (Theban-Spartan War (379-371 BC)).
In 382 the Spartans had seized control of Thebes, but three years later a group of Theban exiles, with help from within the city, had overthrown the pro-Spartan government and expelled the Spartan garrison of the Cadmea, the citadel of Thebes. The first Spartan campaign in Boeotia, in 379, had achieved very little other than dragging Athens into the war. In 378 King Agesilaus II took command, but he did little better, and was eventually forced to retreat after a standoff near Thebes. Before he left he refortified Thespiae, and then left a Spartan garrison in the city, commanded by Phoebidas, the Spartan commander who had seized Thebes in 382.
The Thebans were unwilling to leave the Spartans in peace at Thespiae. A force commanded by Gorgidas, and which included cavalry and probably the Theban Sacred Band, of which he was the commander, was sent to attack Thespiae. Gorgidas began by defeating a Spartan force of 200 men on the road between Thebes and Thespiae. The Thebans then attempted to attack Thespiae itself, but they were repulsed outside the walls. When the Thebans finally decided to retreat, Phoebidas led his peltasts against them, and almost turned the retreat into a rout.
This may have been a feint, designed to draw the Spartan peltasts away from the Thespian hoplites. After retreating for some way the Theban cavalry turned and counterattacked, either because it had reached a ravine that it couldn't pass, or in response to a signal from Gorgidas. In either case Phoebidas was killed and his peltasts were overrun. The Theban cavalry then hit the Thespian hoplites, who were probably in their marching formation. The survivors fled back to Thespiae, where they finally managed to stop the rot and stopped another Theban attack on the new fortifications.
The battle had cost Sparta and her allies 500 dead, and greatly encouraged her enemies. Many Boeotians living in cities allied to Sparta deserted to Thebes. The Spartans responded by sending one of their regiments (morai) to Thespiae, commanded by one of the polemarchs. This helped them maintain a foothold in Boeotia, and helped keep the mountain passes open at the start of Agesilaus's Theban campaign of 377 BC.