On the deposition of Dais bin Sad, Ali appointed Muhammad b Abu Bakr as the governor of Egypt. Muhammad b Abu Bakr was the son of Abu Bakr and his wife Asma married Ali and her son Muhammad was brought up by Ali. Muhammad b Abu Bakr was passionately devoted to Ali. In the revolt against Othman he had sided with the rebels of Egypt. He had entered the room of Othman and held his beard. Othman upbraided him saying, "If your father had been alive, you would not have done like this." At this reproach Muhammad b Abu Bakr withdrew. He was not present when Othman was assassinated.
Muhammad b Abu Bakr was young and handsome. At the time of his appointment as a governor of Egypt, he was twenty-two years of age. Muhammad b Abu Bakr was popular with the young men of Egypt who had rebelled against the authority of Othman and were involved in his murder. All such person called around Muhammad b Abu Bakr, and he conferred high favors on them. In Egypt there were two parties. One party was pro-Othman. They held that Othman was innocent and those who had killed him were guilty of a crime. This party was led by Muawiyah b Hudaij as Sakuni, and Musalama b Mukhallad. They had their concentration in Kharbata in South Egypt. Qais b Sa'ad did not force these people to take the oath of allegiance to Ali. He made a treaty of neutrality with them "hereunder they undertook that if they were not pressed to take the oath of allegiance to Ali, they would remain at peace and would not create any difficulty for the state and would remain loyal to it. It was in pursuance of this treaty that when Muawiyah the Amir of Syria asked them to join him in raising the demand for vengeance for the blood of Othman, they refused to join him. In view of this treaty of neutrality, peace reigned in Egypt during the governorship of Qais b Sa'ad. Muhammad b Abu Bakr had the rashness of youth about him. He came to be surrounded by young men who had rebelled against Othman. Muhammad b Abu Bakr and the people around him considered that they were strong enough to overawe the pro-Othman party, and force them to take the oath of allegiance to Ali. Muhammad b Abu Bakr as Governor commanded these men that they should take the oath of allegiance to Ali within one month. The leaders of the pro-Othman party waited on Muhammed b Abu Bakr and said that his command was in violation of the treaty that they had executed with his predecessor. They advised him to maintain status quo for otherwise the peace of the province would he disturbed. Muhammad b Abu Bakr did not pay treed to their request, and ordered the invasion of Kharbata. In this action the forces of Muhammad b Abu Bakr were defeated, and the pro-Othman party broke into open revolt which disturbed the peace of the province.