Yes, King Xerxes of Persia fought against Sparta during the Greco-Persian Wars, particularly noted during the Battle of Thermopylae in 480 BC. This battle was part of a larger conflict where Xerxes aimed to expand his empire into Greece.
At Thermopylae, a small Greek force led by King Leonidas of Sparta made a valiant stand against the vastly larger Persian army. Although the Greeks were ultimately defeated due to a betrayal that revealed a hidden path allowing Xerxes’ forces to outflank them, their courage and determination have become legendary.
Sparta’s heroic defense at Thermopylae inspired other Greek city-states to unite against the Persian invasion, eventually leading to a decisive Greek victory at the Battle of Salamis later that same year.