W 1656 r., during the reign of Mehmed IV, or rather his mother, sułtanki Turhan, Mehmed Pasha Kóprulu was appointed Grand Vizier – Albanian by origin. Taking office, put a number of conditions, the most important of which were the court's non-interference in its decisions and the absolute freedom of action. This sane and determined vizier led the state to relative peace and prosperity by curbing the claims of powerful lords, administration and Janissaries, as well as a great influence on the harem court. Mehmed Pasha began the reign of the Koprulu family, and when he died (1661), great vizier, with no less privileges, his son was left – Fazil Ahmed. After his early death, the position of vizier was held by a distant relative of Kara Mustafa Pasa. From the mid-16th century. the grand viziers with the entire administration began to work in a residence near the Topkapi Sarayi palace, called High Port (Bab-i Ali). In turn, the Carpet, that is, the council of state, debated inside the palace, and its members, except the grand vizier, there were other high-ranking government officials. Sometimes the carpet gatherings (it met four times a week – on Saturdays, sundays, Mondays and Tuesdays) the Sultan was listening from behind a special curtain.
Thanks to the ordering of internal affairs by the Koprulu viziers, Turkey was able to think about expansion again. Anyway, it was supposed to satisfy the needs of the army, who demanded more wages and loot. In turn, Sultan Mehmed and Kara Mustafa saw great triumphs and the rebirth of the power of the Ottoman Empire in the new expedition.. The first steps were taken by the Turks against Hungarians (Transylvania), where many fortresses and cities were captured, by expanding its possession there. At that time, Crete was also captured, which with Turkey stayed over 200 years. Then, they set out on an expedition to Poland, where rebellious Zaporozhian Cossacks called for help from Turkey. Kamieniec Podolski was conquered in 1672 r., as a result, a shameful peace for Poles was concluded in Buczacz. We gave the Ottomans all of Podolia and we were to pay high annual tribute (lifted by a truce 4 years later). Ukraine has become a fief of Turkey. The Turkish army moved to Vienna. She began to besiege him in 1683 r., and none else has come to rescue, like the king of Poland, Jan III Sobieski (famous Viennese relief). The Turks were smashed, and Kara Mustafa strangled on the orders of the Sultan. The Ottoman army began to withdraw from Central Europe.
In order to settle the disputed matters and conclude perpetual peace, the Sejm of the Republic of Poland decided in 1638 r., that he would send a great legation to Turkey. The king chose an experienced diplomat, tried by himself, in the person of Wojciech Miaskowski, Chamberlain of Lviv, "An educated and discreet man”. The mission took place on 1640 r., and after the expedition there was a diary, in which we read: I greeted in the usual way of great fasts. After the second period of my speech, the emperor himself said: “What a friendship this is to me, which is told by an envoy in the name of his master, when the Cossacks are swimming in the sea and they do damage?” I said: “Let the emperor have a language brought back, will say, it's a Tatar novel, it's danish (i.e.. Donskis – W. K.), Moscow Cossacks, Crimean is news. They complain about Tatar's Cossacks, wanting to cover their crimes, that two months ago in K.J.. Mci, my lord, coming in, they burned down many towns and villages, great numbers of people they were taken captive, which is Istanbul here, from Kaffa (in Crimea – W. K.), full of Kozłów, full and galleys. MP K.J. Mci with gifts keep the sentenced person in prison under guard (it is about Krzysztof Dzierżek trained in 1639 r. na Krym, and there imprisoned by the Tatars and imprisoned in Czufut-Kale – W.K), having taken everything from him, having broken his old and fresh covenants with this crime. I need J.K.M., that the severe Tatars may be punished, prisoners released, damages awarded, the envoy let go and from Budziak to Crimea to spend them the emperor (that is, the sultan – W.K.) he ordered.