Xerxes razed Athens to the ground, killing all those left behind. Some of the Greek states were all for retreating to the Peloponnese and fortifying the Isthmus of Corinth. Worried that they might disperse, Themistocles sent a trusted slave to Xerxes and warned him that this might happen, pointing out that if the Greeks did disperse, the Persians would get bogged down in a long drawn-out war. Xerxes believed Themistocles' advice was sincere and attacked the next day. Again, the Persian fleet outnumbered the Greeks, but the Persians were unable to take advantage of that fact because of the narrow straits they were fighting in.
Although the Greeks won, the Persians still had a huge army in Greece. Themistocles tricked Xerxes again, by sending the same slave with a message that the Greeks were planning to destroy the bridge the Persians had built over the Hellespont, trapping the Persian army in Greece. Xerxes hurried home.
It was generally agreed that Themistocles was the saviour of Greece. Each commander from the different cities put himself first as the bravest, but they all agreed that Themistocles was the second bravest. The Spartans gave their own commander the prize for bravery but awarded the prize for intelligence to Themistocles.
Themistocles continued with his policy of making the Piraeus the main harbour of Athens. He was also responsible for the Long Walls, walls 4 miles long which joined Athens, the Piraeus and Phalerum in a single system of defences. The Spartans had insisted that no fortifications be built outside the Peloponnese for fear that if the Persians ever came back control of fortified cities would give them an advantage. When the Spartans protested about the refortification of Athens, Themistocles was sent to Sparta to discuss the matter. He told the Athenians not to send any other envoys until the walls were at a reasonable height. Once he got to Sparta he refused to open discussions until his fellow -- envoys arrived. When they did, he suggested a delegation of the most eminent Spartans trusted by both sides accompanied by Themistocles' colleagues be sent to investigate the matter. The Athenians then refused to let the Spartan delegation leave until Themistocles was safely home.
At some point in the late 470s Themistocles was ostracised (sent into exile for 10 years by popular vote) and went to live in Argos. While he was in exile the Spartans sent a delegation to Athens accusing Themistocles of being involved in a conspiracy to bring Greece under Persian domination. The Athenians believed the Spartans and he was found guilty in absentia. Themistocles did not feel safe in Argos and took refuge with Admetus, king of Molossia. Admetus refused to give up Themistocles when Athens and Sparta demanded his surrender, but also pointed out to Themistocles that he could not guarantee Themistocles' safety against a joint Athenian-Spartan attack. He did however give Themistocles an armed escort to Pydnus.
From there, Themistocles took ship for Ephesus. He had a narrow escape at Naxus, where the Athenian navy was stationed at the time, but the captain refused to let anyone leave the ship and so Themistocles arrived safely in Ephesus. From there Themistocles took refuge with Artaxerxes, the son of Xerxes, claiming that Artaxerxes owed him a favour since he, Themistocles, had been responsible for his father getting home safely from Greece. Themistocles asked for a year to learn Persian, after which period he appeared at Artaxerxes' court and promised to help him conquer Greece. Artaxerxes assigned the revenues from Magnesia for Themisocles' bread, those from Lampsacus for his wine, and those from Myus for his other food.
Themistocles did not live much longer, however, and died aged 65 at Magnesia. It was most probably a natural death, although Thucydides (1.138.4) reports a rumour that he poisoned himself because he was unable to fulfil his promise to Artaxerxes of helping him conquer Greece.
Primary Sources: Cornelius Nepos' Life of Themistocles:
Plutarch's Life of Themistocles
The Livius website has a translation of what may or may not be the decree of the Athenian assembly for Athens to be abandoned.
Herodotus' Histories:
In Book VII, paragraphs 142-144 tell the story of the oracle about the wooden walls, and how Themistocles founded the Athenian navy.
Book VIII describes the battles of Artemisium and Salamis, and other events of the Persian invasion.
Thucydides' History of the Peloponnesian War:
In Book I, paragraphs 90 and 91 have the story of the fortification of Athens, and paragraphs 135-138 tell how Themistocles ended up in Persia at the court of Artaxerxes.

