After taking office as governor of Egyptfor the first time, he accused his predecessor Silahdar Ibrahim Pasha of failing to pay the customary contribution of every governor of Egypt to the treasury. He sent his kaymakam Salih Bey after Ibrahim Pasha, who told Salih Bey that whatever money he owed, he would give directly to the sultan in Istanbul, where he was headed anyway. However, the deposition of the SultanMustafa I and the succession of Murad IV to the throne, as well as the political chaos around the event that occurred before Ibrahim Pasha arrived back in Constantinople, allowed him to keep the money.
Controversy over replacement
When the sultan replaced Mustafa Pasha with Çeşteci Ali Pasha after only five months in office, as the custom of the sultans was to change the governors of Egypt in rapid succession, the local Ottoman troops marched to the new kaymakams house and demanded the bonus salaries they usually received when the governor was replaced. The new kaymakam delayed them until the next day and at the same time asked them to bring Mustafa Pasha to him, as the kaymakams initial task was to analyze the affairs of Mustafa Pasha; one of the paintings belonging to the seraglio was lost, and it was suspected that Mustafa Pasha had taken it for himself. However, the army refused this request, telling him, The entire army then reportedly swore on the Quran to be resolute in their will. The next day, 11 October 1623, the armies and the sanjak-beys had Mustafa Pasha read the sultan's orders for his replacement and audit. When the army members again demanded compensation from the new kaymakam and deputy governor, they reproached the soldiers by saying that they constantly demanded the same thing every three months, to which the soldiers replied, When the deputy governor replied that he could not compensate the soldiers until the new governor arrived in Cairo, the soldiers grew enraged and nearly killed him and the kaymakam before they escaped. The soldiers then declared, "We will have no other governor than Mustafa; let Ali return to the place from whence he came." As the soldiers welcomed Mustafa Pasha back as governor, he privately wrote to the sultan to ask for a confirmation of his re-commencement of the office, with many local figures also writing to the sultan on his behalf. When the soldiers were informed that the now-unemployed replacement governor Çeşteci Ali Pasha had landed in Alexandria, they sent messengers to inform him of what had occurred. Ali Pasha, angry at the news, proceeded to put one of the messengers in chains, but the troops in the area loyal to Mustafa Pasha released the messenger, destroyed Ali Pasha's camp, and forced him to reembark on his ship. When a wind accidentally brought his ship back to the port, Mustafa Pasha had his troops fire cannonballs at the ship. Because of unfavorable wind conditions, Ali Pasha was forced to spend the winter in another port before heading back to Constantinople. No news arrived from the capital confirming or denying whether Mustafa Pasha was the rightful governor, and the populace began to grow uneasy. Finally, on 16 February 1624, a carrier pigeon arrived with a letter from the sultan in Constantinople confirming the reinstatement, and soon afterwards, the chief footman of the sultan arrived to deliver Mustafa Pasha's governor's caftan.
Second term
In the first year of Mustafa Pasha's second term as governor of Egypt, the Nile flooded to higher-than-expected level, but the waters receded in time for sowing, and a successful harvest followed. Mustafa Pasha reportedly confiscated the inheritances of a large number of wealthy Egyptians for himself, growing wealthy from the practice; when heirs existed, he would reportedly fake their seal and claim their money. Furthermore, the province of Egypt experienced a plague from November 1625 to June 1626, which, although largely restricted to affecting those over 60 years old, nevertheless reportedly killed approximately 300,000 people. To mollify and hasten the grieving process, Mustafa Pasha banned all funerals, and the bodies were carried through the streets and buried without ceremony. Mustafa Pasha was dismissed from the office of governor for the second and final time on 16 May 1626.
Later life
After leaving office, Mustafa Pasha was hounded by his successor Bayram Pasha, who demanded of him a large restitution after auditing the treasury, in a way similar to what Mustafa Pasha himself had done to his own predecessor Silahdar Ibrahim Pasha. Mustafa Pasha, acting as though he could not pay the amount, sold his belongings to further his ruse. However, Bayram Pasha did not let up until Mustafa Pasha paid the entire sum. In 1628, Mustafa Pasha married Fatma Sultan, a daughter of the late Sultan Ahmed I, but that same year, he was executed by the reigning 16-year-old Sultan Murad IV for some action "contrary to the law of God."