While a young man, Xenophon participated in the expedition led by Cyrus the Younger against his older brother, the emperor Artaxerxes II of Persia. Cyrus hoped to depose his brother and gain the throne, but did not tell his mercenaries of this true goal of the expedition. A battle took place at Cunaxa, where the Greeks were victorious but Cyrus was killed, and shortly thereafter their general, Clearchus of Sparta, was captured and executed. The mercenaries found themselves deep in hostile territory, far from the sea, and without leadership. They elected new leaders, including Xenophon himself, who led them north through Armenia and back to Greece. Xenophon's record of this expedition and the journey home was titled Anabasis ("Expedition" or "The March Up Country" which carries in Greek the same connotation it does in English).
Afterwards, Xenophon retired to Athens, but finding the city to be unfriendly, rejoined his comrades and helped the Spartans against Persia. When Athens allied with Persia against Sparta, he was banished, and spent the next few decades at Scillus, where his Anabasis was composed. Later the banishment was revoked, and Xenophon spent his last years at Athens. His date of death is uncertain; it is known only that he survived his patron Agesilaus, for whom he wrote an encomium.