He summoned those who were with Prince Tosun, and they attended. He ordered them to evacuate Egypt and return to their lands. They could not disobey and left with a large number of Arnaut soldiers. He himself set out to fight the Wahhabis and avenge those of his men who had died. He marched with a great army, accompanied by Hassan Pasha Tahir and his brother Abidin Bey. He had not traveled a stage from Cairo when, on the second day, news reached him that the remaining Egyptians had taken control of Aqabat al-Safra and al-Jadida without war or fighting, and that they had found no Wahhabis there. He rejoiced at this and proceeded to Suez, where he stayed for several days. He had abandoned the march to the Hijaz and instead arranged for the armies that were with him to proceed by land, and he landed a group of them on ships and barges. He also sent Mustafa Bey, the governor of Pasha, with all the Dulatliya armies, along with a large quantity of provisions and war equipment. He returned to Egypt. Upon entering Cairo, news reached him that his armies had arrived at the city and had landed in its vicinity. The messenger who brought this news presented the keys to the city. The city was therefore decorated for three nights, the first of which was Thursday, the thirteenth of Dhu al-Hijjah, in the year 1227 AH. He sent the keys with a special messenger to the Sublime Porte.
While some of his armies were fighting the Wahhabis and reclaiming the lands of the Hijaz that they had captured, others were also pursuing the remaining Egyptian princes until they were driven out of Upper Egypt. They continued to pursue them until they reached Nubia and entered Ibrim. They cut off their supplies and blocked their routes, capturing and killing many of their followers. They continued to pursue them relentlessly, killing and scattering them until their threat was eliminated. He then appointed his son Ibrahim over all the southern provinces, giving him full authority to act. He himself began to manage the affairs of the country, undertaking many important projects and beneficial works, such as digging canals, repairing bridges, and constructing forts and strongholds in the city of Alexandria, some of which remain to this day. He established great workshops for launching ships and warships, and prepared a large war fleet, arming it with cannons and weapons. He sent several of these to his son, Prince Tosun. He believed that the power of the Wahhabis had been broken and the influence of their leader, Prince Saud, had fallen. This Prince Saud had indeed withdrawn from fighting Prince Tosun's armies for a time and had retreated with his people to some mountains, but he returned in the year 1228 AH. He attacked them with a large number of his followers near Tarabay, east of Mecca, and captured it. The intense heat had severely affected the Egyptian army. He then marched to Medina and captured all its suburbs and surrounding villages, plundering and looting. He fought the Egyptian armies stationed there, besieged them, and cut off their supplies. Anyone who escaped the siege and tried to retreat was captured and killed. News of what had happened reached Muhammad Ali Pasha, which greatly distressed and angered him. He assembled a large army and set out from Cairo on Friday, the thirteenth of Shawwal, in the year 1228 AH. He encamped at Birkat al-Hajj and then proceeded to Suez. Along the way, messengers met him and informed him of the capture of Uthman al-Mada'iqi by Prince Tosun. This al-Mada'iqi had been