He took the idea out of the ancient legend of Damon and Pythias issuing from the Latin Fabulae by Gaius Julius Hyginus, as rendered in the medieval collection of the Gesta Romanorum.
After a failed attempt by Damon to kill the gruesome tyrant Dionysius, he is caught and sentenced to death but asks for a delay to marry his sister to her designated husband.
To Dionysius' astonishment Damon, despite facing floods, an assault by a bandit gang, beating sun and lack of water on the way back to his own execution, at the last minute returns to save his friend.
Schiller wrote the original version in summer 1798, simultaneously with his poem Der Kampf mit dem Drachen, and published both in 1799.
In the late 1930s, Bertolt Brecht wrote a verse commentary "Über Schillers Gedicht 'Die Bürgschaft'", a sonnet ironically praising the Golden Age in which contract had such moral force that the tyrant realizes that he is hardly needed.