Portuguese–Algerian War (1790–1813)

The Portuguese-Algerian War was a period of diplomatic crisis between Algeria and Portugal, It was marked mostly by a series of naval battles that happened between 1790 and 1813, until they signed a friendship treaty in 1813, ending all hostilities.

Background
There were naval battles between Algerian and Portuguese sailors from the 17th century, particularly in the vicinity of the Strait of Gibraltar and the eastern part of the Atlantic Ocean. These battles escalated dangerously in the last third of the eighteenth century and the first decade of the nineteenth century, especially after the conclusion of a treaty between Algeria and Spain in 1786. The confrontation stemmed from Portugal's refusal to pay taxes to the Algerians. In one battle, Algerian sailors managed to seize 16 ships and 118 prisoners, along with considerable amounts of goods.

War
In 1793, with British mediation, a one-year truce was reached between the Portuguese and Algerians,  in which the Dey was informed Portugal was ready to pay 2,400,000 Francs to complete the truce, further improving the chances of it happening. However, the truce was short-lived, after Portugal started protecting American ships from Algerine corsairs. But they re-established a truce in 1795 however naval battles resumed a year later, in 1796. In 1799, under the command of Rais Ben Tabah, several Xebecs succeeded in capturing 79 Portuguese sailors and their warship. On May 27, 1802, Rais Hamidou successfully captured a Portuguese frigate by deceiving it into believing his ship was English. He also captured the 282 men in the ship, as well as 48 cannons The following day, on May 28, he captured another frigate with 202 men on board and 36 cannons In 1803, Hamidou succeeded in capturing several elite Portuguese men. On March 19, 1806, the Algerians managed to capture several ships from Portugal and Hamburg. In 1807, following a successful mission, Rais Hamidou obtained a Portuguese slave trophy, which he later sold in Morocco for 11,787 Francs. In October 1808, Hamidou captured two Portuguese ships laden with coal and wheat, along with 74 men. In 1810, an Algerian naval force captures 3 Portuguese ships full of tobacco, The commander returned two of the boats and kept the third one for himself.

Aftermath
On June 14, 1813, Portugal was compelled to sign a treaty with Algiers, agreeing to pay a total of 1,027,000 Francs, which included 690,000 for war reparations and 337,000 for the return of 615 Portuguese prisoners, The treaty was signed between Dey Hadj Ali and regent Prince John IV, In addition to this, Portugal would have to pay 16,000 worth of gifts to the Pasha of Algiers.