[sorry, I simply couldn't skip this...]
With the new privileges granted to the Italian and Moroccan subjects of the crown, the (social) preparations for the war were almost finished - the people of Tripoli were already known to endure harsh conditions in wars since the devastating raid of the Archbishop of Aquileia on the Free Cities back in the 15th century.
On the field of actual warfare however there were more worrying things to solve: the first being the huge army the Emperor is able to assemble when his fragile 'Empire' is at stake. All the Emperors' quasi-subjects were committed to send troops for the Imperial Army and that was something the Corsairs and their Alliance was unable to handle - alone.
So Sultan Muhammad made one of the most controversial movement the leaders of Tripoli had done ever...
After a long series of border skirmishes and full scale wars he allied himself with the Sultan of the Ottomans, his main rival as future leader of all the Muslim people on Earth. However it didn't take much effort to convince the Ottomans to sign the treaty and Muhammad didn't have much faith in them anyways. All he needed was more men to send against the Imperials and the vast manpower of the Ottomans was more than fitting for his plan.
The change in the wind in Corsair foreign diplomacy even caused the break-up of the alliance between Tripoli and Mecca as upon the Ottoman conquest of the Dulkadiri Sultanate the two found themselves on opposing sides and Muhammad considered the future help of the Ottomans against the Imperium more important that the given word of his ancestors and faithful allies.
This caused even more unrest amongst the people of Tripoli but (due to the glorious reign of Ali II) the authority of the Sultan was so strong it could get over with situations like this quite easily.
Parallel to this the increasing centralization attempts of Muhammad (and his late father) and the growing piety of the Sultan had caused other uncommon developments in the society with more and more people giving up their 'tribal' identity and considering themselves as a part of a larger whole, something that would be eventually called a 'nation'.
Larger and larger parts of the commoners in the Free Cities adopted Muhammad's ideal of a united Muslim country that could get revenge on the Infidels for their crimes committed in the past and new zealous regiments rose up to aid their leader in his holy quest.
To further exploit the favourable turn of events Muhammad (with a very good sense) ordered the construction of a Monument in memory of his late father, Ali the Reformer "who [with his reign] set the path for the ultimate victory of the True Faith" - as Muhammad interpreted the doings of his predecessor.
However a few key figures in the administration didn't share Muhammad's optimism and very narrowminded (or even blind) zeal and they made sure that the Sultan's betrayal of former allies in favour of former enemies were not to be forgotten for quite some time...
But luck was on the Crown's side - for the time being at least. In late June 1611 a large Yemeni-Hedjazi army was spotted marching from the Arabian Peninsula towards the Holy City of Jerusalem with a plan to depose the "betrayer of his own brothers" and "restore peace between the Muslims of the Earth". The army was surprisingly large indeed but it was not ready for the better equipped and battle hardened forces of Tripoli who took up good defensive positions among the hills of Sinai and were led by Muhammad himself.
The result was a disastrous defeat for the Hedjazi alliance who lost half of their army in the bloodshed while Corsair casualties were around ten percent.
This brought a quick end to the whole war as the defenders made peace with the Ottomans soon after and Dulkadir was annexed by the Ottoman Sultanate.
With this successful rehearsal there wasn't much left to prepare before the biggest venture that the Corsairs ever set sail for begun...
All the allies were mobilized for the war along with the Ottomans while the English, the Portuguese, the Lithuanians (the other realm of the King of Austria) and some German minors came to aid the Emperor in his war. These were worrying news as the English navy was clearly superior to that of the Corsairs'...
However on the western colonies operations begun against the Portugal holdings while one of the main armies marched towards the Portuguese capital from the Northern Iberian holdings of Tripoli.
The fall of fortresses in the very heart of their homeland quickly convinced the Portuguese that they had a very limited chance to achieve anything in this war so they bribed themselves out of it soon...
In the meantime the fighting in the Balkans (which was the main theatre for this war) just began with two larger Imperial armies operating there - one in the south besieging the Ottoman forts in Greece and one in the North crossing the Danube and heading towards Constantinople.
While the former was way too large and had too good defensive positions for the advancing allied army coming from the Greek holdings, the latter was caught by surprise in the marshes of the lower Danube near the delta and was utterly destroyed by one of the Corsair forces.
In the next month, worrying number of Imperial reinforcements started to pour into the Balkans and even the Sultan himself suffered a rather convincing defeat in the mountains of Albania.
It seemed that the combined armies of Tripoli and the Ottomans didn't not have the numbers required to stand against the overwhelming lines of the Imperials.
Soon after Kozani fell to the Austrians and their army moved on towards Athens while their reinforcements laid siege to the Bulgarian fortresses - and their numbers just kept increasing...
Atop of that some of the Christian subjects of Tripoli on the Achaean Peninsula saw the war as an opportunity to revolt against the reign of Muhammad - they were clearly traitors to Tripoli's cause and while Muhammad didn't have spare troops to deal with the situation "properly" the incident further fueled the Sultan's anger towards Christians.
At least the forts of Kozani were assaulted and seized back quickly from the unsuspecting Imperial garrison - yet it didn't help much the overall situation which seemed a bit dire for Muhammad and his allies.
Luckily for him (again) Syrian reinforcements had arrived during the fall of 1612 and with their help one of the Austrian armies was succesfully trapped and forced to surrender in the Montenegrin mountains.
With the Ottoman forces advancing in Transylvania and the Imperial forces still hopelessly besieging Turkish forts in Greece the tides were slowly turning in favour of Muhammad.
And what was even more surprising - the huge English navy didn't make any sign of life during the conflict. To ensure that it won't show up later to disrupt the supply lines in the Mediterranean, Muhammad sent envoys to the English king to negotiate on a peace between the two power. Muhammad was willing to renounce Corsair claims on the otherwise rather poor territory of Ancona to see the English leave the conflict for good.
Then all that remained were the Emperor and his closest subjects, the Palatine and the Lithuanians.
In the meantime, with a cunning move, the Corsair fleet - which was free to operate on the Mediterranean now - transported the now idle army from Iberia to the allied ports in Aquileia so it could break into the undefended heartland of the Empire.
Though it also caused some shortage in the supplies on the Balkans - which eventually led to another defeat in Albania - with their Capital fallen the chances of winning the war were decreasing rapidly for the Imperials.
Yet still there were two huge armies of them operating in the Balkans. Each of them was way too large for any allied army to defeat them in a single battle and Corsair supplies were also dwindling - along with the fighting values of the exhausted armies.
Two years passed without any significant change on the fronts.
In early 1615 in a daring move to finally end the war Muhammad chose to attack the army led by the Emperor himself but he was defeated and the main Imperial army was still intact.
The supplies of the Emperor were not infinite though and with his heartland occupied he wasn't able to resist for ever. By the summer of 1615 desertion became a serious problem for Imperial armies and the time for peace was closing.
In the meantime the war economy of Tripoli was more than successful and even there was money to spare on things like the extension of the school system which was funded by the University of Tripoli some decades ago.
And finally... by September 1615, with the last remnants of his army annihilated, the Emperor bowed to the will of Muhammad and was ready to sign a peace - though the Sultan was not in a position to demand much as his own armies were in the brink of disintegration too.
So the peace treaty was somewhat kind to the Emperor: he had to cede Ancona to the Pope (it was the price for him not openly agitating against Muhammad when he was waging war against the Emperor), Trent to the Duke of Tirol, Dalmatia to the Archbishop of Aquileia and the city of Ragusa (along with its important port) to Tripoli.
The war strengthened Muhammad's vision about the destruction of Christian authority and showed that the forces of Tripoli are capable when it comes to fight the Imperials - though it also proved that the vast manpower of the Holy Roman Empire also makes their armies extremely hard to defeat.
And it was still an open question if Muhammad is to succeed with his plan to disintegrate the main Christian powers and bring a new golden age for Islam...