Those Athenians who believed that their victory at Marathon in 490 BCE meant the war with Persia was over were mistaken. Persian king Darius I immediately set about raising a new and far larger force. To pay for it, he raised taxes. This led to a revolt in Egypt in the winter of 486–485 that disrupted grain deliveries and diverted Persian military resources to restore order in that important province. Darius died in late 486. His son and successor, Xerxes, was temporarily distracted by the Egyptian revolt but, once it had been crushed, he returned to the invasion of Greece.

News of the Persian preparations reached Athens, and the Athenian leader Themistocles urged that the city build the largest possible naval force. Athens then had only 50 triremes in commission; Themistocles wanted 200, but the conservatives in power, led by Miltiades, who had distinguished himself at Marathon, opposed such a step.

In 489, the Assembly voted to send Miltiades with 70 ships (20 of them purchased from Corinth) to attack the island city-states that had assisted the Persians. After pressuring some of the other islands back into the fold, Miltiades moved against the Cycladic island of Pardos, which had provided one trireme to the Persians. The city refused to pay the 100 talents he demanded to sail away, and Miltiades commenced siege operations. Following a month-long effort, however, he was forced to admit defeat and returned with the fleet to Athens. This humiliation led to Miltiades's arrest and trial on a charge of treason. He was sentenced to death but this was subsequently reduced to a fine of 50 talents. Unable to pay this large sum, he was sent to prison, where he died of gangrene from a leg wound sustained in the siege.

The disgrace of Miltiades and his faction left Themistocles the dominant political figure in Athens. He did what he could to prepare the city-state for war. Themistocles reformed the government to allow long-term war planning, then secured approval to increase the fleet to 200 triremes.

When he at last set out for Greece in 481, Xerxes commanded one of the largest invasion forces in history to that time. Its exact size has been debated ever since. Modern reckoning puts it at perhaps 600 ships and three Persian army corps of 60,000 men each. This was a Persian advantage of at least 3:1 on land and 2:1 at sea.

In the spring of 480, the Persian host reached the Dardanelles (Hellespont). There Egyptian and Phoenician engineers had constructed a bridge that was among the most admired mechanical achievements of antiquity. Herodotus tells us that they distributed 674 boats in two rows athwart the strait, each vessel facing the current and moored with a heavy anchor. The engineers then stretched flaxen cables across the ships from bank to bank. These cables were bound to every ship and made taunt by the use of capstans on shore. Wooden planks were then laid across the cables, and fastened to them and to one another. The planks were covered with brushwood, and this with earth, and the whole was tamped down to resemble a road. A bulwark was erected on each side of this causeway to keep animals from taking fright of the sea. In seven days and nights, the Persian forces passed over the bridge and entered Europe.

The Persian army quickly occupied Thrace and Macedonia. The northern Greek city-states were completely intimidated, surrendering to fear or bribery and allowing their troops to be added to those of Xerxes. Only Plataea and Thespiae in the north prepared to fight.

For once, however, Athens and Sparta worked together. Athens provided the principal naval force, while Sparta furnished the main contingent of land forces sent north to resist the Persians. The land force was under the command of King Leonidas of Sparta. The Greek plan was for the land forces to hold the Persians just long enough for the fleet to force a Persian withdrawal. Themistocles led the Athenian fleet. Joined by other Greek vessels to make 271 front-line ships, it sailed north to meet the Persian force of more than 650 ships. A storm reduced the Persian naval forces to around 500 serviceable warships, but this was still a comfortable advantage in numbers.

On an afternoon in mid-August, the Greek fleet attacked the Persian ships off the northern coast of Euboea, at Artemisium. The battle was inconclusive, although the Greeks managed to capture some 30 Persian vessels.

The allied Greek land force of about 4,000 men under Leonidas had, meanwhile, taken up position at the Pass of Thermopylae, some 135 miles north of Athens. Today, because of sedimentation in the Gulf of Malis, the pass of Thermopylae is several miles inland, but at the time of the Persian invasion it was a narrow track between the waters of the Gulf of Malis to the south and cliffs to the north. Leonidas selected the site because here a small force could hold off a much larger one. Three hundred Spartan men-at-arms formed the nucleus of Leonidas's force, accompanied by perhaps 900 helots. Leonidas had chosen only fathers with sons so that no Spartan family line would be extinguished.

The same day that the fleets clashed at Artemisium, Xerxes launched his first attack against the Greek defenders at Thermopylae. They were driven back. Xerxes committed his famous Guards Division, the Ten Thousand Immortals, but they too were forced back in disorder. The pass was piled high with corpses. Xerxes tried again the next day, but the defenders repelled this assault as well.

Leonidas and his troops were eventually overwhelmed, however, not by the bravery of the Persians but by the treachery of Hellenes. On August 19, a Greek, Ephialtes of Malis, betrayed to Xerxes, apparently for reward, the secret of an indirect route over the mountains. He led a Persian force by that approach, routing a lightly held Phocian outpost that Leonidas had positioned to block this route and turning the Greek position.

On the night of the second day of battle, when he learned from Ionian Greek deserters from Xerxes's army that they were going to be cut off, Leonidas permitted the allied Greeks to withdraw. Herodotus wrote, "I incline to think that Leonidas gave the order, because he perceived the allies to be out of heart and unwilling to encounter the danger to which his own mind was made up. He therefore commanded them to retreat, but said that he himself could not draw back with honor; knowing that, if he stayed, glory awaited him, and that Sparta in that case would not lose her prosperity," (Herodotus, 424–425). An oracle had foretold that either Sparta would be overthrown by the barbarians or one of her kings had to perish.

Seven hundred Thespians and 300 Thebans refused the order to withdraw and remained with the Spartans. Only two Spartans are said to have survived; one fell at the Battle of Plataea a year later, and the other hung himself in shame. Over the tomb of the Spartans was placed the most famous of Greek epitaphs: "Go, stranger, and tell the Lacedamonians [Spartans] we lie here in obedience to their laws."

This battle, which is also said to have claimed two younger brothers of Xerxes, had far more psychological than military importance. While some Greeks saw it as an excuse to ally with the Persians, others admired the Spartan example and redoubled their efforts to resist the Asian tide.