[5] At Istanbul, however, he was eventually traded into a prestigious household, that of the notable Tahsin Bey, a Cypriot Ottoman who was the naqib al-ashraf (head of the Prophet's descendants) and qadi al-'askar (chief judge of the army) of Anatolia, and a poet.
In 1846 he accompanied the bey, as part of small staff which included the influential advisor Bin Diyaf, during a two-month state visit to France, after which he was made brigadier general.
This trip was of special cultural and political significance in that the orthodox bey traveled for an extended stay to a non-Islamic country in order to acquire familiarity with its modern methods of operation and governance.
The French took care to show France to advantage; the small Tunisian party was well received by top government officials and leading private citizens.
Yet shortly thereafter he was sent to Paris to arrange a loan for the bey's regime, but where instead he spend four years attempting to reclaim large sums embezzled by the notable Mahmud bin 'Ayyad, former head of the newly created national bank of Tunis, who with foresight had already secured French citizenship.
During his years occupied with negotiations in Paris, Hayreddin also managed to browse libraries and bookshops, to improve his French, asking many questions, and to study European society, industry, and finance.
This involved construction to improve harbor facilities in order to handle the increased commercial shipping, as Mediterranean trade grew markedly.
"It seems probable that Khayr al-Din married the two sisters for the sole purpose of producing male progeny but wed Kmar, his fourth wife, out of love.
[19][20] Mustafa Khaznadar, although the Grand Vizier and servant of the Bey, could be an avaricious dealer in extortion, and good at it as well, becoming quite wealthy; while Hayreddin was known to be a committed opponent of tyranny and corruption.
This seaside villa lies between the port of La Goulette and Carthage; near where now stands a modern rail station called "Khéreddine" (named after either Barbarossa or al-Tunisi).
[23] A contemporary European diplomat who "worked with him closely and on friendly terms" describes Hayreddin during the years when he served as the bey's chief minister: "He was a stout, burly man, with a somewhat heavy countenance, which was occasionally lighted up with a very intelligent... expression... .
[26] The reformist constitution promulgated in 1861 established new institutions of government, in particular an advisory and legislative body called the Majlis al-Akbar or Grand Council.
Yet strong opposition and factional intrigues of the existing leadership, largely directed by the long-time Grand Vizier, Mustapha Khaznadar, quickly developed which made the situation unworkable for a reformist agenda to prevail.
His 1867 book Aqwam al-Masālik fī Ma'rifat Aḥwāl al-Mamālik [The Surest Path to Knowledge regarding the Condition of Countries] makes a comparison between European and Muslim states.
[31] While prime minister under Sadok Bey, Hayreddin establish the Habus Council in 1874 to improve the utility of the extensive lands given to religious trusts.
Legal changes were made to existing qanun law so that it might better encourage trade and commerce; the result was later called "le code Khaïreddine" which affected contracts and obligations.
The first regards his coordination with the Tunisian ulama in order to make the government reforms; the second his familiarity with European political institutions: "Reform in politics necessitates renewal in religious matters, including rational interpretation of the divine scripture and cognizance by the learned scholars of Islam of worldly matters and events in order for them to be able to render contextual understanding of the sacred texts.
The subsequent synergy between luminaries within, on the one hand, the state machinery and, on the other, the Zaytuna mosque university drew a reformist itinerary that still indelibly inspires the engineering of renewal agendas in modern day Tunisia.
At the spacious mansion in Istanbul given him by the sultan, Hayreddin remained in retirement during his last decade, but his rheumatoid arthritis made life difficult and his exile brought him some bitterness.
[38] In French he dictated his memoirs to several different secretaries skilled in the language, indicating that the Francophone world was an important target audience, whether in Africa, in Europe, or in the Middle East.
[39] A close reading of Khayr al-Din, especially his memoirs and later writings (perhaps written frankly, without ulterior intent), shows him to favor traditional government like the Ottomans, opines Prof. Brown: Khair al-Din "was always well within the mainstream of medieval Islamic political thought, with its emphasis on stewardship, i.e., a rigid separation between the rulers and the ruled, whose mutual relations were guided by the parallel of the shepherd and his flock... .
Brown then quotes at some length, from Khayr al-Din's memoirs, a passage which describes the pre-existing corruption of the Beyical government as the source of the problem during his years as Grand Vizier.
As the reformist solution, Khayr al-Din sought to "create a new administrative system, based on justice and equity, to destroy abuses and arbitrary actions" and restore "the government in its sacred role of protector of the people" and so "conduct the country on the road to prosperity.
"In the mamluk tradition at its best, Khayr al-Din gave unwavering loyalty to the Husaynids [the Beys of Tunis] and sultans [of the Ottoman Empire]--until their policies violated his notion of just government informed by his own lived experience, Islamic moral precepts, and chosen European political principles.
... As a borderland intellectual, he operated at multiple points of intersection: between the Maghrib and the Ottoman Empire; Europe and North Africa; the central Mediterranean corridor and the sea writ large; the universe of the philosopher-educator and the statesman.
"[42]During his last years, Hayreddin also turned to writing memoranda on the reformation of the Ottoman regime addressed to the unreceptive Sultan Abdul Hamid II.
[43] He married four time: His character appears in Sami Fehri's television series, Tej El Hadhra, portrayed by actor Yassine Ben Gamra.