Following the Ottoman loss at the
Battle of Navarino,
the new captain of the largest "Ship of the Line" in the World built 2 years after,
made a course to Libya to boost the morale of the North African peoples. Also, on board was a young man named Abd-El-Gelil, a native of North Africa. When the ship anchored in Tripoli, he was granted some shore leave and decided to visit his home town deep in the Libyan desert. It was there where he found and met Gûma ben Khalifa.
Gûma ben Khalifa was an idealist and wanted to unite the North African provinces. He wanted to end the Ottoman rule and forge a strong independent Empire. Abd-El-Gelil discussed plans on how best to achieve this, and he was able to convince Gûma, that it would be best to make it a people's revolt and once support is gained for the movement, and Empire could be formed.
Abd-El-Gelil returned to Tripoli and found that he had missed the sailing of his ship and was now listed as a deserter and to be arrested on sight and tried. He then escaped the city with help from a few compatriots and made his way back into the desert, to consider his next move.
Now back in the desert, he plotted with Gûma their next moves. They decided it would be better if they could start a revolt in one of the smaller cities or towns and gather momentum from there. This they did and for the next few weeks they worked towards Benghazi. When they got their they discovered that the Governor of Tripolitania had been torturing and killing the residents and there was no love for him or the Ottoman's. This was more that the pair could have hoped for and were able to recruit 100's for their cause and in the dead of night an assassin was despatched to remove the deputy Governor of Tripolitania based in Benghazi. When that happened, all resistance in Benghazi fell away.
The Governor of Tripolitania, then decided to make an example of Benghazi and with support of the Ottoman ship, Mahmudiye, providing shore bombardment they attempted to restore control, with his best troops available. This left Tripoli virtually undefended and the opportunity was not lost by the duo, who sent a force from deep in the desert to Tripoli and soon had the Governor holed up in his palace. Meanwhile word spread throughout Libya that a people's revolt was spreading and many 1,000's had now joined the cause.
The Governor surrendered, and his harem was freed to great joy to their families, who welcomed them back. The Governor was then told, you could either face a people's trial here or return to Istanbul. He took the latter and was given a passage on the Mahmudiye. Pockets of resistance continued for about another two years but by 1831 it was all but over.
The Libyan people were so pleased to be free of the Ottomans's they appointed Gûma ben Khalifa as their new leader. He immediately set about setting up a new government and made the young Abd-El-Gelil Prime Minister and instructed him to form a cabinet from the best people he could find. At their very first meeting they decided in honour of the leadership of Gûma ben Khalifa, had shown that he be conferred the title of "Most Supreme Emperor of Libya" and so the Libyan Empire was born.