We did not risk our lives simply to change the players Egyptian demonstrators have been calling for President Morsy to step down. Khaled Fahmy says he invalidated his vote in Egypt's 2012 presidential elections But he says he recognized the legitimacy of Mohamed Morsy when he won Fahmy says he participated in the revolution in the hope of police and defense reform Morsy, he says, is no longer legitimate because he failed to meet the terms of his mandate Editor's note: Khaled Fahmy is the chairman of the history department at the American University in Cairo. Follow @khaledfahmy11 on Twitter. (CNN) -- Two days before Hosni Mubarak was ousted as president of Egypt, I wrote an article for CNN calling for the Muslim Brotherhood to have a place in the post-Mubarak Egypt. Back then, I wrote: "As a secularist, I am not in favor of the Muslim Brotherhood coming to power in Egypt, and I remain deeply skeptical of its political program, believing that much of it is vague and impractical. But as an Egyptian hoping for freedom and justice for my country, I am deeply convinced that the Muslim Brotherhood has a place within a free and democratic Egypt. A year and half later, and after participating with my fellow Egyptians in an inspiring peaceful revolution, I went to cast my vote in the first free presidential elections Egypt had ever witnessed. I was not happy with either candidate: Ahmed Shafik, a hawkish representative of the former regime, and Mohamed Morsy, the candidate of the Muslim Brotherhood. I invalidated my vote. Khaled Fahmy Still, given that these were free and fair elections, I recognized the winner, Morsy, as the legitimate president of Egypt. Even though I never believed that he or his organization, the Muslim Brotherhood, had a solution to my country's woes, I accepted the result of the vote, and prepared myself for the hard work that needed to be done over the coming four years, his term in office, so that we could have a chance to topple him in the next presidential elections. Read more: Egyptian military, president clash All of this changed six weeks ago. At midnight on May 18, 2013, I went down to Tahrir Square to sign the "Tamarod" (rebel) campaign petition calling on Morsy to step down immediately. And on June 30, I marched with millions of other Egyptians in the largest demonstrations our country has ever witnessed reiterating the same demand: Morsy has to step down. What changed? What happened in Morsy's first year in office that forced me to change my mind and decide to rebel against him? Are the millions of people who marched in the streets demanding his immediate resignation, including myself, bad losers who simply could not accept the result of the first free and fair elections Egypt has ever witnessed? Or are we revolutionaries who have seen some of the main demands of our revolution go unfulfilled? Even though I had invalidated my vote, I had a sigh of relief that Shafik did not win the elections. He had pledged to adopt a policy of blood and iron to "cleanse Tahrir" of the revolutionaries. Had he won the elections, I thought, I would have had to join my fellow compatriots to hold on to our newly-won territory and to make sure that the demands of our revolution were fulfilled. Morsy's win, I thought, meant I could catch my breath and continue our struggle for a free and democratic Egypt, while keeping a watchful eye on the new president. However, Morsy undertook a series of disastrous steps that made me question my briefly held guarded optimism. Morsy had won with a mere 51.7% of the vote. I expected him to understand the implications of this figure: he did have a mandate, but Egypt was divided and his prime duty would be to close its rifts. Morsy should have worked hard to include the opposition in the key decisions facing his troubled country. He should have tried to win the trust of the half of the nation that had not voted for his presidency. Instead, Morsy adopted a hard line, exclusive approach and trusted no one but the most extreme of his group, the Muslim Brotherhood. The cabinet he chose and the governors he selected were either Muslim Brotherhood members or sympathizers of the iron-clad, clandestine organization. In a revealing speech, Morsy addressed members of the organization as "my family and folk," raising doubts among many Egyptians as to his true sympathies: with the country at large or with his secretive organization. And instead of reaching out to the center, he courted the fundamentalist salafis on the extreme right. Crucially, this resulted in a constituent assembly which was dominated by Islamists and which ended up drafting a deeply flawed constitution. Still, I considered Morsy to be my president. Read more: Salafis call for Islamic law in Egypt protest Throughout the fall of 2012, Morsy and his Muslim Brotherhood launched an all-out war against Egypt's judiciary. As a student of this institution, I recognize the Egyptian judiciary's venerable history but also realize that, like many of Egypt's institutions under Mubarak's long reign, it has suffered from nepotism, corruption and ineptitude. But the president and his group were convinced that the judiciary was out to get them, so they launched a coordinated attack aiming to bring it into line. They dismissed the Prosecutor General (akin to the U.S. Attorney General), ordered their followers to lay siege to the Constitutional Court and drafted a law sending to retirement more than 3,000 judges whose sympathies were suspected of lying with the former regime. The culmination of this pogrom against the judiciary was a constitutional coup in November 2012 in which Morsy declared himself to be above the law and his orders to be immune from any judicial oversight. With no sitting parliament and with the judiciary under a ferocious attack, we had a dictatorship in the making. Read more: Egypt's Morsy says courts can't overturn him Putting an end to police torture and curbing the power of the military are not easy matters. But neither is risking one's life in a revolution. Throughout the first year in his term of office, Morsy showed little respect for or tolerance of the opposition, repeatedly accusing it of being in the pay of the feloul, a derogatory term in Egypt which literally means remnants of a defeated army, but which has come to refer to members of the former regime. Instead of accepting that the job of the opposition is to oppose, and that of the government to govern, he blamed his own shortcomings on what he believed was a conspiracy by the opposition to thwart his efforts and to bring about his downfall. Increasingly, he and his Muslim Brotherhood became more and more intolerant of all dissenting voices. Thus, they allowed their followers to lay siege on the "Media City," a congregation of studios of independent TV stations at the outskirts of Cairo. They drafted a draconian law which would have curbed the work of NGOs and which is much worse than anything that Mubarak had ever passed. A freedom of information draft law, in which I personally had participated in drafting, was rejected by the Ministry of Justice by proposing an alternative text that makes a farce of freedom of information. For many months now, Morsy and his Muslim Brotherhood have been performing a slow and sinister "Brotherhoodization" policy, whereby senior, and not so senior, officials in Egypt's bureaucracy are being replaced by Brotherhood members. I do understand that in the wake of any elections the winning side is expected to make some changes to the administration so that the new regime can execute their policies. But these changes are typically limited to key positions within the administration, usually the first and second tiers, leaving the third and fourth ones intact to ensure stability and continuity of the civil administration. Brotherhoodization policy The Brotherhoodization policy has gone way beyond what is normally expected in any healthy transitional process. In addition to the provincial governors -- who are gradually being replaced by Brotherhood members -- the Police Academy is reportedly being infiltrated by members of the clandestine organization. Within the Ministry of Education, replacements have reached the level of school principals. And the new Minister of Culture has replaced the head of the Cairo Opera House, dismissed the head of the Cairo Ballet Company, the head of the Egyptian Book Authority (the largest government publishing house), and the director of the National Library and the National Archives. The new appointees have no credentials except being members or sympathizers of the Muslim Brotherhood. What prompted me to rebel against Morsy and forced me to decide that he was no longer a legitimate president -- no longer my president -- is not anything he did, but two things he did not do, namely, bring the army under civilian control and undertake a serious process of security sector reform. I am a historian of modern Egypt, and for the past 25 years, I have been working on the history of these two specific institutions: the military and the police. I have come to realize the enormous cost paid by the Egyptian people in founding what are two crucial pillars of any modern state. I have also come to the conclusion that -- without subjecting the military to civilian rule and without undertaking a serious effort to reform the Egyptian police -- our bid for freedom, dignity and social justice will always be thwarted. When our revolution broke out on January 25, 2011, millions participated for different reasons. There were those who rebelled against endemic corruption, and there were others who aimed for a more equitable distribution of wealth. My personal cri de guerre was curbing the power of the army and subjecting it to civilian rule, and reforming the Egyptian police. Along with millions of my compatriots, I marched in the streets of Cairo and risked my life in Tahrir to achieve these two goals: subject the army and its secretive budget to parliamentary scrutiny and ending the endemic torture within Egyptian police stations. Morsy and his Muslim Brotherhood have miserably failed to tackle either of these two lofty goals. Most crucially, the constitution which was written by the president's organization and their other Islamist allies failed to subject the military budget to parliamentary oversight, stipulate that the minister of defense be civilian, or end the flawed process whereby civilians are tired in front of military tribunals. Similarly, Morsy has taken no measures whatsoever to reform the security sector. He failed to understand the significance of the revolution being launched on January 25, which is Police Day, the date having been carefully chosen by the youth organizers to send a clear message that we demand to live in a country with no torture. All proposals to reform the sector were forcefully snubbed by Morsy's government. Not a single police officer accused of torture under Mubarak's long reign has been brought to justice. The culture of impunity within the Ministry of Interior has not been rectified. And torture continues to be practiced in Egyptian prisons, jails and other places of detention. Personally, the turning point came on April 24, 2013. On that day my driver's cousin, Wael Hamdi Rushi, was killed in the Heliopolis Police Station. He had had a fight with a shop keeper who summoned the police. The police came and arrested Wael with his brother. In police custody, he objected to the way they were treating his 14-year old epileptic brother. So they smashed his head against the wall until he died, hanged his body from a rope in his prison cell and called his mother to watch him dangling from the ceiling. Wael was 19. Values of the revolution We launched this revolution not only to have free elections, but to have a new Egypt in which we can live in dignity and freedom. Regrettably, our first democratically elected president in Egypt, one who owes his position to a revolution that he did not launch nor did his organization believe in -- except in the eleventh hour -- clearly does not believe in the values of this revolution. Winning with the slimmest margins, he found himself confronted by a stern judiciary, a hostile press, a powerful army and a corrupt police force. An unenviable situation, it is true, but he had the revolution behind him. Had he turned to us, we would have helped him tackle the army and the police, not overnight it is true, but we were willing to fight on. Instead, he chose to direct his wrath against the judiciary and the press, while letting the army and the police off the hook. We did not launch this revolution nor risk our lives only to change the players. We wanted to change the rules of the game. That was the mandate we gave to Morsy. He has failed in this crucial task, so we no longer recognize him as a legitimate leader. He has broken the terms of the mandate. And our revolution continues. The opinions expressed in this commentary are solely those of Khaled Fahmy.