Fazıl Mustafa Köprülü Pasha, the second son of the grand vizier Köprülü Mehmed Pasha, had received a theological education, but had spent most of his early years on military service with his brother Fazil Ahmed Pasha, the next grand vizier.
After his brother's death in 1676 and that of brother-in-law, Kara Mustafa, in 1683, Fazil Mustafa Pasha, who had been vizier since 1680, had to resign.
Later, however, when another brother-in-law, Abaza Siyavuş Pasha, became grand vizier for the third time, Fazil Mustafa Pasa had on October 2, 1687, been made second vizier; they both play a major role in in the deposition, by the combined forces of Yeğen Osman and the janissaries, the now highly unpopular Mehmed IV on November 7.
(Mehmed will spend the last three years of his life in retirement in Edirne.)
However, the rebels soon turn against them, and Fazil Mustafa Pasha saves his life only with the protection of the new sultan, Süleyman II, Mehmed’s younger brother.