As told by Aristoxenus, and after him Cicero (De Offic. 3.45), Diodorus Siculus (10.4), and others, Pythias and his friend Damon, both followers of the philosopher Pythagoras, traveled to Syracuse during the reign of the tyrannical Dionysius I (r. 405–367 BC). Pythias was accused of plotting against the tyrant and was sentenced to death.
Accepting his sentence, Pythias asked to be allowed to return home one last time, to settle his affairs and bid his family farewell. Not wanting to be taken for a fool, the king refused, believing that once released, Pythias would flee and never return.
Damon offered to take his spot while he was gone. The king agreed, on the condition that, should Pythias not return when promised, Damon would be put to death in his place. Damon agreed, and Pythias was released.
Dionysius was convinced that Pythias would never return, and as the day Pythias promised to return came and went, Dionysius prepared to execute Damon. Just as the executioner was about to kill Damon, though, Pythias returned.
Apologizing to his friend for his delay, Pythias told of how pirates had captured his ship on the passage back to Syracuse and thrown him overboard. Dionysius listened to Pythias as he described how he swam to shore and made his way back to Syracuse as quickly as possible, arriving just in time to save his friend.
Dionysius was so pleased and astonished with their friendship that he pardoned them both. It was also said that Dionysius then sought to become their third friend, but was denied.
Another version says that it was a test planned out by Dionysius and his courtiers. The Pythagoreans were known for their claimed moral strength and superiority. Courtiers of Syracuse believed that they were fakes, while others disagreed. The plan was devised to test the Pythagoreans’ moral strength in a time of crisis.