quality:correction, linguistic:paraphrasing, structural:reformatting
Rivalry with the West

By 1699, the Ottomans had been driven out of Hungary, Poland - Lithuania and parts of the western Balkans in the Great Turkish War. In the Great Divergence, Europe had overtaken the Muslim world in wealth, population and technology. (Some historians argue that science had already been in decline in the Muslim world since the 14th century while other argue that sciences still continued until the 17th century.) The Industrial Revolution and growth of capitalism magnified the divergence, and from 1768 to 1918, the Ottomans gradually lost territory.

Greece, Serbia, Romania, and Bulgaria achieved independence during the 19th century, and the Ottoman Empire became known as the " sick man of Europe ", increasingly under the financial control of European powers. Domination soon turned to outright conquest: the French annexed Algeria in 1830 and Tunisia in 1878 and the British occupied Egypt in 1882, though it remained under nominal Ottoman sovereignty. In the Balkan Wars of 1912–13 the Ottomans were driven out of Europe altogether, except for the city of Constantinople and its hinterland.

The British also established effective control of the Persian Gulf, and the French extended their influence into Lebanon and Syria. In 1912, the Italians seized Libya and the Dodecanese islands, just off the coast of the Ottoman heartland of Anatolia. The Ottomans turned to Germany to protect them from the western powers, but the result was increasing financial and military dependence on Germany.