The exiled Spartan king who warned Xerxes about Greek fighting ability was Demaratus. A former Eurypontid king of Sparta, Demaratus had been deposed after a political struggle and fled to the Persian court, where he became an adviser to Xerxes I.
Before the Persian invasion of Greece in 480 BC, Xerxes questioned Demaratus about whether the Greeks—especially the Spartans—would resist. Demaratus explained that the Greeks were politically divided but that the Spartans were bound by law and discipline to fight. He warned Xerxes not to assume that numerical superiority would guarantee an easy victory.
Demaratus's advice is especially associated with the defense of Thermopylae. In Herodotus's account, he describes Spartan training and obedience to the law, contrasting them with the Persian king's assumption that the Greeks would flee. His warning proved prescient when the allied force held the pass for several days despite being heavily outnumbered.
Demaratus is sometimes confused with Cleomenes, the Spartan king involved in his deposition, or with Leonidas, who commanded the defense at Thermopylae. Those men belonged to the story, but Demaratus was the exiled adviser who spoke to Xerxes.