At the Battle of Pteria in 547 BC, the Persian forces of Cyrus the Great fought a drawn battle with the invading Lydian forces of Croesus, forcing Croesus to withdraw back west into his own kingdom.
Background
Formerly, the Lydians and Medes had arranged that the natural boundary between the two empires would be the Halys River. Croesus learned of the sudden Persian uprising and defeat of his longtime rivals, the Medes. He attempted to opportunistically use these set of events to expand his borders upon the eastern frontier of Lydia. He made an alliance with Chaldea, Egypt and several Greek city-states, including Sparta.
Motives
Croesus may have intended re-instating his brother-in-law, Astyages on the Median throne. It is also possible that he was trying to pre-empt a Persian invasion of Lydia.
Battle
Croesus began the campaign with an invasion of Cappadocia, crossing the Halys and capturing Pteria, then capital of the district and formidable as a fortress; The city was sacked, and the inhabitants enslaved. Meanwhile, Cyrus had advanced to halt the Lydian incursion, and the armies met in the vicinity of the fallen city. The battle appears to have been fierce, but indecisive; Both sides sustained considerable casualties; in the aftermath, the outnumbered Croesus withdrew across the Halys. The retreat of Croesus is represented by Herodotus as a strategic decision to suspend operations until their armies were more evenly matched, by arrival of reinforcements from his allies the Babylonians, the Egyptians and particularly the Spartans. Though losses were more or less equal, Croesus apparently thought he had inflicted sufficiently heavy losses on the Persians to cripple Cyrus for the winter, as he disbanded his army shortly after reaching his own territory.
Aftermath
Among historians, the outcome of the battle remains debatable and unclear. Before all of this, and prior to his invasion, Croesus asked the Oracle of Delphi for advice. The Oracle suggested vaguely that, "if King Croesuscrosses the Halys River, a great empire will be destroyed." Croesus received these words with delight, instigating a war that would ironically and eventually end not the Persian Empire but his own. The dispersal of Croesus' army exposed Lydia to the unexpected invasion of Cyrus, who followed almost immediately on Croesus' steps, pursuing him to Sardis. The rival kings fought again at the Battle of Thymbra, before Sardis, which ended in a decisive victory for Cyrus the Great.