huc dum hibernis iam mensibus traicit, circa Pharmacussam insulam a praedonibus captus est mansitque apud eos non sine summa indignatione prope quadraginta dies cum uno medico et cubicularis duobus. nam comites servosque ceteros initio statim ad expediendas pecunias, quibus redimeretur, dimiserat. numeratis deinde quinquaginta talentis expositus in litore non distulit quin e vestigio classe deducta persequeretur abeuntis ac redactos in potestatem supplicio, quod saepe illis minatus inter iocum fuerat, adficeret... Sed et in ulciscendo natura lenissimus piratas, a quibus captus est, cum in dicionem redegisset, quoniam suffixurum se cruci ante iuraverat, iugulari prius iussit, deinde suffigi.
While crossing to Rhodes, after the winter season had already begun, he was taken by pirates near the island of Pharmacussa and remained in their custody for nearly forty days in a state of intense vexation, attended only by a single physician and two body-servants; for he had immediatley sent off his travelling companions and the rest of his attendants, to raise money for his ransom. Once he was set on shore on payment of fifty talents, he did not delay then and there to launch a fleet and pursue the departing pirates, and the moment they were in his power to inflict on them the punishment which he had often threatened when joking with them... Even in avenging wrongs he was by nature most merciful, and when he got hold of the pirates who had captured him, he had them crucified, since he had sworn beforehand that he would do so, but ordered that their throats be cut first.(Suetonius, Divus Iulius 4, 74)
The ransom of fifty talents mentioned by Suetonius was originally, according to Plutarch, set at twenty:
To begin with, then, when the pirates demanded twenty talents for his ransom, he laughed at them for not knowing who their captive was, and of his own accord agreed to give them fifty.
Plutarch also elaborates on the threats and jokes mentioned by Suetonius:
For eight and thirty days, as if the men were not his watchers, but his royal body-guard, he shared in their sports and exercises with great unconcern. He also wrote poems and sundry speeches which he read aloud to them, and those who did not admire these he would call to their faces illiterate Barbarians, and often laughingly threatened to hang them all. The pirates were delighted at this, and attributed his boldness of speech to a certain simplicity and boyish mirth. But after his ransom had come from Miletus and he had paid it and was set free, he immediately manned vessels and put to sea from the harbour of Miletus against the robbers. He caught them, too... and crucified them all, just as he had often warned them on the island that he would do, when they thought he was joking.(Plutarch, Life of Caesar 2)