The siege of Thebes (479 BC) followed the Greek victory over the invading Persians at Plataea, and ended after the main Persian supporters in Thebes surrendered.
When Xerxes invaded Greece in 480 BC the Thebans had decided to side with the Persians. A Theban contingent had fought on the Greek side at Thermopylae, but had surrendered on the third day, and their involvement was probably not entirely voluntary. As Xerxes moved south, Thebes publicly supported him, and as a result Boeotia was left untouched as the Persians marched into Attica. The Persians then suffered a naval defeat at Salamis, and Xerxes decided to return home. Part of his army, under the command of his brother-in-law Mardonius, was left in Thessaly to continue the war in the following year.
In 479 Mardonius returned to Attica and occupied Athens for a second time, but this (and severe Athenian pressure) finally convinced the Peloponnesians to move north to fight the Persians in Attica or Boeotia. The decisive battle was eventually fought at Plataea, just inside Boeotia, and the Greeks won a crushing victory. The defeated Persians and their Greek allies retreated in different directions. The Persians moved towards Phocis and the long road home, while the Greeks took refuge in Thebes.
The victorious Greeks spent some time burying their dead (and arguing about who had performed best at the battle). They then decided to move against Thebes. They reached Thebes ten days after the battle, and demanded the surrender of the main Persian supporters and in particular Timagenidas and Attaginus.
The Thebans refused to surrender their leaders, and so the Greeks began a siege of the city, both attacking the walls and devastating Theban farmland in the hope that this would force the city to surrender.
This policy paid off. After twenty days Timagenidas offered to surrender in order to avoid more suffering, as long as Thebes agreed to provide money to pay any ransom. Unsurprisingly the Thebans accepted this offer, and the surrender was soon negotiated. Attaginus was clearly more aware of their likely fate, and managed to escape, but Timagenidas and the other ringleaders surrendered.
Pausanias was also aware that some of his fellow Greeks were likely to accept bribes to arrange for the freedom of the Theban leaders, and so he quickly took them back to Corinth and had them executed. At the same time the Greek army was dissolved, ending the campaign in mainland Greece. Fighting did continue in Asia Minor and the Hellespont region. On the same day as Plataea the Greeks defeated the Persian fleet in a land battle at Mycale, and then went on to besiege their headquarters in the Hellespont region at Sestos.