On January 25, 1703, he was promoted to the post of Grand Vizier, the highest post of the Ottoman Empire other than that of the
Sultan. However he soon realized that the
Sheikh ul-Islam Feyzullah, who wielded great influence on the sultan
Mustafa II, was the
de facto ruler of the empire. The Sultan gave strict orders to Rami Mehmed to seek Feyzullah's approval in all of his decisions, a regulation which reduced the status of the Grand Vizier to a subordinate of the
Sheikh ul-Islam. Even under this unfavorable situation, Rami tried to reform the post-war economy and the navy, but his term was too short to carry these reforms through. Both Feyzullah's almost unlimited authority and the Sultan's insistence on residing in
Edirne rather than Constantinople, the capital, caused reactions among the soldiers and the citizens in Constantinople. In the summer of 1703, they revolted against the Sultan. At the end of this revolt known as
Edirne event, Rami Mehmed as well as the Sultan were deposed on August 22, 1703. == Death ==