After the newly appointed Bey of Tripoli, Sidi Yussuf, demanded an increased tribute, which essentially constituted a bribe to stop Tripolitans preying on Danish merchant ships.
He had two missions: first, to escort the annual "gift ship" to Algiers, and second, to secure the freedom of the two Danish vessels and their crews.
He arrived at Tripoli on 30 August 1796, but failed to free the captured sailors, or even agree on a ransom price.
They also hired a xebec of six guns, which was then sailed by a Danish crew under Lieutenant Hans Munck (or Munk), of Sarpen.
The Norwegian Poul S. Stub, who was held in slavery in Tripoli after his merchant ship Providentia had been captured, observed the battle from the land and wrote up his impressions.