As I noted a while back, on December 20, 1777, the Sultan of Morocco issued a decree allowing ships flying the new American flag to trade freely at Moroccan ports, which is sometimes seen as the first foreign state to recognize American independence. (The Dutch East Indies had already saluted the flag, but formal recognition by the Home Dutch Government was later.) It wasn't until 1779 that the Americans (who were busy fighting Redcoats) actually noticed, after Ben Franklin in Paris called their attention to it and the Sultan (Franklin called him "the Emperor") had been asking. Finally in 1786 a Treaty of Friendship and Cooperation was signed, the Treaty of Marrakesh. Morocco never asked the US for tribute and avoided the conflicts its neighbors faced in the Barbary Wars. An American Consulate was established in Tangier, and in 1821 the Sultan gave the US the building which has since been the consulate (until 1956, the US' main diplomatic post in Tangier). It's said to be the oldest US diplomatic property still in use.
Against this background (and then as now the Moroccans were proud of their priority as American allies), in early 1862 the Consulate in Tangier became entangled in a messy diplomatic dispute over the seizure of two Confederate agents. Tangier was, at the time, under the typical sort of foreign concession under which European consuls (including the US as honorary Europeans) had legal jurisdiction over their nationals. And Morocco recognized the United States of America, and unlike many European states had not declared neutrality in the American war, so Confederate States citizens had no standing.
Also important background: the United States had just resolved a major crisis with Great Britain known as the Trent Affair, in which an American naval captain, acting on his own, intercepted a British ship at sea and removed two Confederate agents, Mason and Slidell, who were en route to London and Paris respectively. The British reacted with threats of war, including a buildup of troops in Canada, and Lincoln, saying he could fight only one war at a time, had to release the Confederate agents. That was resolved in January; in February a US consul in Morocco created a new, if lesser, diplomatic problem along the same lines.
|CSS Sumter Running the Blockade, 1861|
Pursuing US vessels stood outside the territorial limit, in effect blockading her in Gibraltar; she was in need of repairs and still denied coal.
|Raphael Semmes, CSA Navy|
|Thomas Tate Tunstall|
|LT Henry Myers, CSN|
In any event, someone reported the two Confederates' presence in Tangier. The US Consul at the time, James DeLong, deciding that the Sumter had essentially been engaged in piracy, that Tunstall was a former US diplomat and Myers a defector from the US Navy, decided to have them arrested. Using his consular privilege he got the Moroccan authorities to arrest them and deliver them to the consulate, where they were quite literally clapped in irons.
|US Consul James DeLong|
He then tried the French, since the two captives had debarked from a French ship and, in his view, should have had French consular protection. He wrote to Confederate agents Mason in London and Slidell in Paris, but to little avail. The naval supply ship USS Ino sailed to Tangier to take custody of the captives. There were extensive protests by the European trading community in Tangier, and reportedly the Ino's commander had to draw his sword to the crowd to bring them aboard, still in irons.
To add insult to injury, the Ino sailed first to Algeciras, within full view of Semmes aboard the crippled Sumter in Gibraltar across the bay. It then took them to Cadiz, where another US vessel took them to Boston.
Semmes' efforts, however, did have some eventual effect. The French government eventually complained; pressure from other consulates reportedly led to some questions in Morocco, and there were murmurings in the British Parliament. Perhaps as a result, Lincoln (while not disavowing the arrests as in the Trent Affair), ordered that the captives be considered not as Americans arrested for treason but as prisoners of war. Lt. Myers was accordingly exchanged for a Union POW in Confederate hands, and Tunstall, the civilian, allowed to return to the South.
Tunstall, however, immediately began a career as a blockade runner, was captured, and this time his captors insisted he could only be paroled if he agreed to stay abroad for the duration. He did.
Interestingly, though, Tunstall after the war again served as a US Consul: President Cleveland sent him to El Salvador, where the Spanish he had learned in Cadiz was of use.
Lincoln didn't apologize, but in March, 1862, a few weeks after all this, he did relieve James DeLong as US Consul in Tangier, the man who started it all. I suspect he wished he hadn't been quite so proactive.
Note on sources: I'm drawing this from multiple sources, including Semmes' memoirs, biographies of him and obituaries of Tunstall, the Official Records of the Union and Confederate Navies, etc. I can't cite them all here.