The Bombardment of Algiers, 1816
Derek Severn describes how the assault secured the release of many slaves and much ransom money but Barbary pirates remained a menace until the French annexation.
The ending of the Napoleonic Wars brought about a decisive change in Britain’s attitude to the Barbary States. For more than two centuries its policy had depended upon expediency, since British naval and commercial shipping had no reliable source of supplies in the ports of the Catholic countries, Spain, France and Italy. It was convenient, therefore, to ignore both piracy and slavery for the sake of the food and water that were to be had on the North African coast; and Britain had maintained a consul in Algiers since the latter part of the seventeenth century.
The war against Napoleon had increased this need; victory removed it, and, when the British Government under Castlereagh set out to abolish slavery, it was obliged to satisfy its allies that its humanitarian concern extended to white slaves as well as black.