The
most significant figure among the Ottomans of the seventeenth century
was Mehmet Koprulu (1570-1661), who, as Grand Vezir , halted the
general decline of Ottoman government by rooting out corruption
all through the imperial government and returned to the old Ottoman
practice of closely observing local government and rooting out injustice.
He also tried to revive the Ottoman practice of conquest and protecting
Muslim countries from European expansion. Although it didn't happen
in his lifetime, this new expansionist policy would begin the steady
stream of military defeats against European powers that would slowly
contract the Empire.

Wars with Austria

Shortly
after Mehmet Koprulu died, his brother-in-law, Kara Mustafa, took
over the military and put into practice Koprulu's new expanionist
policies. His first target was the Hapsburg Empire of Austria. He
wanted nothing less than the complete conquest of Austria, so he
marched straight for the capital, Vienna. In 1683, with Vienna under
siege, the Ottomans were defeated by an alliance of European forces
and by the heavy artillery that had come into practice among European
armies. While this defeat initiated a long period peace in the relationships
between the Ottomans and the Europeans, it also effectively ended
the Ottoman wars of conquest, and the end of conquest also began
the steady deterioration of Ottoman power over European territories

In 1699, the Ottomans signed the Peace of Karlowitz.
In this treaty, the Ottomans handed over to Austria the provinces
of Hungary and Transylvania, leaving only Macedonia and the Balkans
under Ottoman control, but the Balkans had begun to destabilize
after the Ottoman defeat of 1683.