Tunisian navy (1705–1881)

Until 1815 the Beylik of Tunis maintained a corsair navy to attack European shipping, raid coastal towns on the northern shores of the Mediterranean and defend against incursions from Algiers or Tripoli. After 1815 Tunis tried, with limited success, to create a modern navy, which fought in the Greek War of Independence and the Crimean War.

The corsair age
Corsairing was less important to the economy of Tunis than to the other Barbary States, but under Yusuf Dey in the early seventeenth century it grew in scale, and the capture of foreign ships became a key source of income for the ruler. Each time a ship was captured it went to the Bey as booty, together with half of its crew - the remainder being divided among the corsairs themselves.

To be sustainable, corsair activity needed a significant investment in shipping, skilled people and scarce resources, and these were only intermittently available in Tunis. The selling of European captives back to their countries of origin and the purchase of ship hulls from foreign ports went on continuously, but at times when the profitability of agriculture or trade rose, corsair activity tended to decline, as, for example, during the periods 1660–1705 and 1760–1792. Like Algiers and Tripoli, Tunis needed to import most of the materials necessary to build and maintain a fleet, including rope, tar, sails and anchors and the wood necessary to convert captured merchantmen into warships.

The Beys of Tunis sent out their fleets on their own account, but also derived income by chartering part of their navy to privateers. The Ben Ayyed family chartered 36 percent of the Tunisian corsair fleet between 1764 and 1815 (making them the second largest), paying a tithe (uchur) for the privilege, but the profits they yielded were not significant.

Shipbuilding and naval organisation
The Tunisian corsair fleet consisted mainly of xebecs and galiots, many of them converted merchant ships. In the eighteenth century the European powers abandoned the galley and began building larger ships of the line. While a xebec could carry up to 24 guns, European battleships commonly carried 74 guns after 1750. It thus became increasingly difficult for Tunis to build, equip, man or maintain a naval force that could remain effective in the face of other modern navies in the Mediterranean. In the seventeenth century Tunis and the other Barbary states depended on Christian European craftsmen to build its ships and naval installations; this was less the case by the eighteenth century but the Tunisian navy always depended on imported finished goods. As Tunis sought to keep apace with the European fleets, it relied less on privateering and developed the infrastructure of a state navy.

The main port for the corsair navy was Porto Farina, sixty kilometres north of Tunis. It offered shelter under Cape Farina from the northeast wind. It was slowly silting up as a result of the outflow of the Medjerda River, and eventually became unusable for larger ships. Some galleys were maintained at Bizerte and there were also naval installations at La Goulette. A naval arsenal was built in Porto Farina in 1707, but by 1769 the site seems to have been abandoned and the facility moved to La Goulette. The Venetians bombarded Porto Farina in 1784, but after this no foreign navy paid attention to it.

Hammuda Pasha sought to increase Tunis’ naval autonomy by building modern naval shipyards at Porto Farina and La Goulette as well as a cannon foundry in Tunis, which employed Christian slave labour and used materials imported from Spain. The harbour at La Goulette was exposed to enemy attack, so in 1818, fearing that Lord Exmouth would destroy his entire navy as he had the Algerian fleet, Mahmud Bey had the entrance to Porto Farina dredged clear do that he could move his ships back there, where they could shelter in the lagoon. However, after the destruction of the Tunisian fleet in the storm of 1821, Porto Farina was effectively abandoned again.

One of the noteworthy aspects of how the Tunisian navy was organised was that for many decades it was the charge of one man, Mohamed Khodja. He was originally appointed by Ali Bey in around 1780 as commander of the maritime fort of Bizerte. The commander of the ships themselves was first admiral Mustapha Raïs, and after 1825, Mohamed Sghaïer, and Hammuda Pasha soon appointed Mohamed Khodja as director of the naval arsenals (amin el-tarsikhana). After 1818 Mohamed Khodja had the task of reforming the Tunisian navy and reconverting the corsairs and their ships. He remained in post even after the defeat at Navarino, and served until his death in 1846 in a role which came to resemble that of a modern Minister of the Marine. One of his sons Ahmad, who predeceased him, was commander of Porto Farina while another, Mahmoud, succeeded him in his role as amin el-tarsikhaneh.

Treaties and conflict (1705–1805)
When the Husainid dynasty took power in Tunis in 1705, piracy and privateering had long been part of the country's economy. Over time, various maritime countries signed treaties with Tunis, agreeing to make gifts and payments in return for security against attack and enslavement. For example, the 1797 treaty with the United States assured a payment to Tunis of $107,000 in return for not attacking American shipping. An offer from Sweden in 1814 worth 75,000 piastres to the Bey, with regular payments every three years to secure the safety of its shipping was considered inadequate and not accepted. In 1815, the Netherlands offered the Bey half a million francs in presents to ensure the free movement of its ships.

Having secured these subsidies with the threat of piracy, Tunis and the other Barbary states did not always adhere to their obligations, and at times they still seized shipping from countries with which they had treaties. In 1728 the French, in exasperation, decided that a show of force was necessary. On 19 July 1728 a naval force under Etienne Nicolas de Grandpré consisting of two ships of the line, three frigates, a flute, three bomb galiots and two galleys left Toulon. When this fleet appeared off La Goulette the Tunisian navy did not oppose it and the Bey quickly agreed to France's terms. (Tripoli refused them, and was bombarded for six days).

By the late eighteenth century the Tunisian fleet was no longer capable of posing a threat to the major European naval powers. When a dispute over Corsican shipping and the rights to coral fishing in Tabarka led to the outbreak of war with France in June 1770, the Tunisian fleet did not attempt to engage the French navy, which was able to bombard Porto Farina, Bizerte and Sousse with impunity. In 1784 a dispute with the Republic of Venice led to war; on 1 September a Venetian fleet of three ships of the line, a frigate, two xebecs and a galiot appeared off Tunis. Supported by two British frigates, this force sailed to Porto Farina, bombarding it repeatedly between 9–18 September. Sailing back, the Venetians then bombarded La Goulette from 30 October - 19 November. They returned in 1786, bombarding Sfax repeatedly from 18 March - 8 May, Bizerte in July and Sousse in September. In no case did any Tunisian fleet put to sea or offer resistance - the country relied entirely on shore batteries for defence.

If the Venetian bombardment showed that Tunis was no longer a major naval force, it could still pose a threat to its neighbours. Thus in 1799 a fleet of twelve corsairs under the command of Mohammed Rais Roumali raided San Pietro Island off Sardinia, carrying its entire population away into slavery.

The Barbary Wars and war with Algiers (1805–1815)
In 1804 Tunisian naval power consisted of one thirty-six gun frigate with another under construction, 32 xebecs with between 6 and 36 guns, thirty armed galleys and ten gunboats. That year Tunis attempted, unsuccessfully, to secure the delivery of another frigate from the United States as the price of maintaining the peace. Hostilities were threatened during the First Barbary War when the USS Constitution seized a Tunisian corsair and its prizes that were attempting to run the US blockade of Tripoli. When the USS Vixen appeared off Tunis in July 1805, a Tunisian gunboat opened fire on her and gave chase. The Vixen continued on her way into port, and neither she nor Stephen Decatur, aboard the USS Congress, returned fire. During the Second Barbary War the United States demanded compensation for two American vessels that had been seized by the British in the War of 1812 and held in Tunis as prizes. To secure peace, Tunis agreed to pay compensation, reversing thirty years of established practice whereby the USA maintained peace by paying the Barbary States.

The Regency of Tunis fought a protracted conflict with the Regency of Algiers over many years, almost entirely on land. However, in May 1811 an Algerian fleet entered Tunisian waters and engaged a Tunisian force off Sousse. The Algerian squadron consisted of six large ships and four gunboats under the command of Raïs Hamidou; the Tunisian of twelve warships under Mohammed al-Mourali. Fighting was confined to the two flagships but after six hours of combat Mourali was compelled to strike his colours and surrender. The rest of the Tunisian fleet took shelter in Monastir while the Algerians sailed home with their prize. This was the first serious naval engagement the two regencies had ever fought, costing 230 Tunisian and 41 Algerian lives. In 1812 the Algerians returned, and blockaded La Goulette with nineteen ships from 24 July to 10 August. Both sides were careful to avoid escalation, so neither opened fire on the other.

In August 1815 the Tunisian fleet made ready to face another incursion by the Algerians, An Algerian naval fleet attacked a Tunisian fleet but failed in front of a Tunisian fleet. Muhammad|Mahmud Bey]] dispatched eight Corsair ships under Moustafa Reis to pillage the coasts of Italy, hoping to amass both slaves and treasure. After several fruitless raids over six weeks, the fleet attacked Sant'Antioco in Sardinia, seizing 158 slaves before returning to La Goulette in October loaded with booty. This was the last major raid undertaken by the Tunisian fleet, and it was instrumental in bringing about an end to its historic activities.

The end of the corsair age (1815–1821)
After the final defeat of Napoleon in Europe in 1815, the powers gathered at the Congress of Vienna to agree a new political order. One of the questions they considered was the slave trade and the continuing depredations of the Barbary corsairs. Sardinia in particular urged the powers to take decisive action to free the captives from Sant’Antioco and from previous raids, and to prevent any other attacks in future. To resolve these matters Britain dispatched a fleet to the Barbary states under Lord Exmouth, who carried authority to negotiate an end these practices from a number of European powers, including Great Britain, Hanover, Sardinia and Naples.

Exmouth's force of eighteen warships appeared off La Goulette on 10 April 1816. The Tunisian fleet made no attempt to resist it. Mahmud Bey agreed to Exmouth's terms, and a treaty was signed with the European powers on 17 April 1816. As a result of Exmouth's expedition, 781 slaves and prisoners were redeemed from Tunis (along with 580 from Tripoli and 1514 from Algiers).

In 1820 the Tunisian navy had three 48-gun frigates, and this sizeable force was deployed to attack Algiers, which had violated its peace agreement by attacking Tunisian shipping. The Tunisian navy set off to make a show of force off Algiers at the end of October, and did manoeuvre between Algiers and the Balearic Islands, but based itself in Livorno to be safe against any counterattack. Towards the end of December it returned to La Goulette, having exhausted its supplies.

It remained at La Goulette when a huge storm blew up on 7–9 February 1821, driving 21 ships aground in the Gulf of Tunis and damaging many others. Among the ships lost were the Bey's three frigates, together with three corvettes, a brig, a schooner and a xebec. This loss had serious consequences for Tunis, leaving it unable to prosecute the war with Algiers and destroying the naval superiority it then enjoyed with its neighbour. Tunis therefore agreed to accept the Sublime Porte’s offer of mediation, and signed a peace agreement with Algiers in March. It also left Tunis unable to provide immediate naval assistance to the Ottomans in the Greek War of Independence.

Defeat at Navarino (1821–1837)
As well as destroying ships, the storm of 1821 also carried away all their crews - around two thousand seamen with the skills and experience to sail them. To maintain a first-rate navy, Tunis could not rely on locally-built ships and needed to purchase vessels from the leading European naval yards. In March 1821 Mahmud Bey sent Mourali and other agents to Marseilles, Trieste and Venice to see whether any warships could be purchased, as well as to Istanbul to recruit new experienced crews.

To replace the ships lost, two frigates, the Hassaniya and the Mansoura, two corvettes and a brig were ordered from the shipyards at Marseilles while three vessels were purchased at La Goulette. As soon as they were delivered, the frigates were sent to support the Ottomans in Greece.

In March 1827 Sultan Mahmud II requested additional Tunisian naval support in Greece. Husayn Bey responded by sending a flotilla to the Morea that consisted of two frigates, two corvettes and two brigs. (A different account says two frigates and one brig). In October 1827 the Tunisian ships were surprised along with the rest of the Ottoman navy and completely destroyed at the Battle of Navarino, leaving Tunis obliged to rebuild its navy from scratch for a second time in six years. In May 1828 two new brigantines had been built at La Goulette - these remained the only effective warships in Tunis until 1830. When the Ottoman government made a fresh request for warships in 1829, the Bey declined to send them. These ships were insufficient force prevent the Kingdom of Sardinia and the Kingdom of the Two Sicilies from blockading Tunis in 1833, forcing the Bey to sign a favourable commercial treaty. As before, Tunis did not want to risk losing its warships by giving battle.

The defeat at Navarino prompted Husayn Bey to decide that his warships needed to fly under a distinctive flag so as to distinguish themselves from other squadrons in the Ottoman fleet. This was the origin of the flag that later became the national flag of Tunisia. The flag was officially adopted in 1831.

Tunisian forces played no part in the conflict between France and Algiers between 1827 and 1830; indeed the losses from Navarino were not fully replaced until 1834 when a 44-gun frigate and two corvettes were commissioned in Marseilles. The order was for ships with flat bottoms which could safely enter the harbour at La Goulette, which was sanding up. The first of the new frigates was launched on 3 November and named Husayniyya. By this time the French conquest of Algeria had prompted the Ottomans to re-occupy Tripoli and consider invading Tunis as well.

Ahmed Bey and the Crimea (1837–1855)
An 1839 French consular report lists the Tunisian navy as comprising:


 * one 44-gun frigate (disarmed)
 * two 24-gun corvettes
 * two 22-gun corvettes (disarmed)
 * one 20-gun corvette (disarmed)
 * one 16-gun brig (disarmed)
 * one 10-gun schooner (in dry dock)
 * two large gunboats (disarmed)
 * twelve smaller single-gun gunboats (disarmed)
 * two small single-gun cutters (disarmed)

By 1840 all of the world's major navies had built or were building large steam-powered warships. Tunisia's first steamship was bought in 1841 but unfortunately sank in less than a year. The Dante, a 160-ton steamship was presented by the French government to Ahmed Bey in 1846 after it took him to France on his state visit. Unfortunately the Dante ran aground in a storm off La Marsa and had to be decommissioned. Around a year later France replaced it with a second vessel the Minos, in 1848. It remained stationed in Tunisia under a French captain until the death of Ahmed Bey; his successor Mohammed Bey requested its withdrawal as an economy measure.

In the meantime Tunis was building and purchasing other ships to strengthen its naval capacity. Work began building a new frigate, the Ahmadiya in La Goulette in 1841. The channel connecting the basin with the sea was not wide enough to accommodate a ship of its size, but the Bey was convinced that it could be modified once the warship was built. The ship was launched on 2 January 1853 but remained marooned in the pool for years, unable to sail out because the widening had not been undertaken. Eventually it was broken up, having never reached the sea.

Ahmed Bey also bought craft such as the aviso Essed and the frigate Sadikia as well as other modern ships, the Béchir and Mansour. The Bey's plan was for this fleet to be based in Porto Farina where new port installations had been built. However, the silting up of the harbor of Porto Farina by the Medjerda River prevented this project from coming to fruition.

Following the death of Mohamed Khodja in 1846, Ahmed Bey appointed his son fr:Mahmoud Khodja to succeed him as Minister of the Marine. In 1853 he brought engineers from France and Italy to rebuild the arsenal at La Goulette arsenal as well as various coastal forts. In the same year the Ottoman government expressed surprise that the Bey of Tunis, as a loyal subject, had not offered to assist against Russia on the event of war. The Bey responded that he was ready to assist, possibly because a show of loyalty to the Ottomans would undermine the French policy of treating Tunis as independent when pressing its own demands. Mahmoud Khodja was responsible for chartering more than sixty ships to transport the 14,000 Tunisian troops who were sent to support Turkey. They mostly served in the garrison at Batum where their numbers were thinned by epidemics.

Hayreddin Pasha and the French invasion (1857–1881)
In 1857 Muhammad Bey reorganised his government along modern ministerial lines and following the death of a Mahmoud Khodja made Hayreddin Pasha Minister of the Marine, a post he occupied until 1862. The ministry figured in Tunisia's first ever national budget, for 1860–61. The amount allocated, 754,000 piastres, was only half of what Hayreddin had requested as necessary to keep the navy fed and supplied. During the time he was minister the Tunisian navy consisted of two frigates, five old steamships and ten sailing ships of various sizes. They were all in a poor state of repair and in October 1862 only one frigate was capable of leaving port. It was useless as a military force and its main activity was transporting livestock to keep the troops in the south supplied with meat, but in March 1862 the fleet was in such poor condition that the government had to charter foreign ships for the task. Hayreddin's main purpose was to modernise and fit out the port of La Goulette so that it could serve as a safe winter port for the fleet; as it could no longer accommodate ships of any size, the navy was obliged to shelter in the roads off Sfax.

After Hayreddin Pasha Tunis had Navy Ministers who served only brief terms, Ismail Kahia (1862-3), General Rashid (1862-5), Mohammed Khaznadar (1865–72), Mustapha Ben Ismaïl (1873-76) and finally, on the eve of the French occupation, Ahmed Zarrouk (1876–81). In 1877, at the outbreak of the Russo-Turkish War, the Ottoman government asked Tunisia for assistance once again, but Tunisia did not have the financial means to assist.

During the French invasion of Tunisia in 1881, the Tunisian navy offered no opposition.