"Continued delays by American officials exasperated the sultan and prompted him to take more drastic action to gain their attention. On October 11,1784, the Moroccans captured the American merchant ship, Betsey. After the ship and crew were taken to Tangier, he announced that he would release the men, ship, and cargo once a treaty with the United States was concluded. Accordingly, preparation for negotiations with Morocco began in 1785. On March 1 Congress authorized the commissioners to delegate to some suitable agent the authority to negotiate treaties with the Barbary States. The agent was required to follow the commissioners' instructions and to submit the negotiated treaty to them for approval. Congress also empowered the commissioners to spend a maximum of 80,000 dollars to conclude treaties with these states. Franklin left Paris on July 12, 1785, to return to the United States, 3 days after the Sultan released the Betsey and its crew."
The whole account is worth reading.
By the way, yesterday marked the 50th anniversary of Moroccan independence.