PresidentWhen Mr Mursi took office on 30 June 2012 as Egypt's first democratically elected head of state, he appeared to have relatively little power.
Two weeks earlier, the then ruling Supreme Council of the Armed Forces (Scaf) had issued an interim constitutional declaration amending the 30 March 2011 declaration promulgated following the overthrow of Hosni Mubarak the previous month.
The interim declaration restored all legislative powers to the Scaf until fresh elections were held for the lower house of parliament, the People's Assembly. The generals had decided two days earlier to dissolve the chamber in line with a Supreme Constitutional Court ruling that the law governing the recent elections was unconstitutional. The Scaf also gave itself control of the military budget and also the national budget until parliament reconvened.
The declaration also gave the Scaf responsibility for "all issues related to the armed forces" and stated that its head was to serve as defence minister until a new constitution was drafted. A third major amendment gave the generals - as well as the president and the Supreme Council for the Judiciary - the power to appoint a new constituent assembly if it was unable to complete its job and also to demand the revision of any articles of the draft charter.
The president was left with authority over administrative and domestic affairs, but with the Scaf's generals lurking in the background.
Following his inauguration, Mr Mursi moved swiftly to challenge the generals' power. Within days he issued two decrees creating a committee to investigate the killing of protesters during the 2011 uprising and recalling the dissolved People's Assembly. The latter was subsequently overturned by the Supreme Constitutional Court.
A month later, in the wake of the killing of 16 border guards in Sinai by suspected Islamist militants, Mr Mursi issued a series of edicts that reconfigured the political landscape of Egypt.
On 12 August, he amended the 2011 constitutional declaration, revoking the interim declaration issued by the Scaf in June and transferring the authorities the generals had assumed over the previous year and a half to the presidency, including absolute legislative authority.
Mr Mursi also made a series of personnel changes in top military positions, including forcing the retirement of the head of the armed forces and defence minister, Field Marshal Mohammed Hussein Tantawi, and his chief-of-staff, Gen Sami Annan, and legally reinserting himself as chairman of the Scaf - a position previously held by Mr Mubarak.
It was not clear that the president had authority over the military changes, but they appeared to be made with the generals' acquiescence.
The response to Mr Mursi's August decrees was by and large favourable, with only truly negative comments coming from groups opposed to the Muslim Brotherhood, the Islamist group to which the president belongs.
However, there was widespread anger on 21 November when, with the constitutional assembly on the brink of collapse and protests over the slow pace of change 20 months after the overthrow of Hosni Mubarak, Mr Mursi issued an emergency decree granting himself broad powers above any court as the guardian of Egypt's revolution.
Article 1 of the declaration ordered retrials for Mubarak - who was sentenced to life in prison in June 2012 - and other former regime and security officials accused of responsibility for killing protesters during last year's uprising.
Article 2 stated that all constitutional declarations, laws and decrees issued by Mr Mursi since he took office were "final and unchallengeable by any individual or body until a new constitution has been ratified and a new parliament has been elected".
All pending lawsuits challenging his decisions were void, it added, pre-empting an expected ruling by the Supreme Constitution Court on the legitimacy of the constituent assembly, requested by liberal and secular groups who believe it is dominated by Islamists. Most secular members and representatives of the Coptic Church have walked out.
Mr Mursi's declaration also gave the constituent assembly a further two months to finalise the draft constitution and stated that both it and the upper house of parliament, the Shura Council, could not be dissolved by the judiciary.
The president also replaced the public prosecutor, Abdel Maguid Mahmoud, a Mubarak appointee widely criticised for failing to win stronger prison sentences against the former leader and his associates, and against abusive police officers. Mr Mursi had been forced to back down in October when he attempted to force Mr Mahmoud to resign. Only the Supreme Council for the Judiciary currently has the power to dismiss the public prosecutor.
Article 6 of the declaration granted the president the "power to take all necessary measures and procedures" against any potential threat to the revolution, national unity or national security.
Mr Mursi portrayed his declaration as an attempt to fulfil popular demands for justice and protect the transition to a constitutional democracy.
ParliamentThe lower house of parliament, the People's Assembly, was tasked under the 30 March 2011 constitution declaration with determining the "public policy of the state, the general plan for economic and social development, and the public budget of the state". It was also supposed to oversee the work of the executive branch.
However, on 15 June 2012 the Scaf issued a decree dissolving the People's Assembly, a day after the Supreme Constitutional Court found the law that governed Egypt's first democratic elections in more than six decades unconstitutional. The court ruled that party members should not have been allowed to contest the one third of the seats designated for independents. The Muslim Brotherhood's Freedom and Justice Party (FJP) won several 235 seats in the People's Assembly by running candidates for individual seats, as did the ultraconservative Salafist Nour party.
On 17 June, the Scaf issued an interim constitutional declaration that gave it all legislative powers until a new parliament is elected. The decree also gave the generals power to form a new constituent assembly to draft the new constitution, replacing the 100-member panel which had previously been selected by parliament. The make-up of the constituent assembly had proved controversial, with liberals, youth activists, secularists and Christians complaining that it was dominated by Islamists and did not reflect the diversity of Egyptian society. A compromise was eventually reached but then parliament was dissolved. The generals, president, prime minister and judges can now also demand the revision of articles in the draft constitution.
Nine days after taking office, President Mursi unexpectedly issued his own decree ordering the People's Assembly to reconvene, challenging the Scaf's decision to dissolve it. Mr Mursi called on the generals to respect a popular will that was expressed through free elections. He said he was not ignoring the Supreme Constitutional Court because fresh elections would be held a month after the new constitution was approved, but its judges responded by insisting their decisions were "final and not subject to appeals". In the end Mr Mursi backed down.
The upper house, the Shura Council, was not affected by the Supreme Constitutional Court's ruling or the Scaf decree, as its elections were separate to those of the People's Assembly. The Shura Council is a consultative body that only gives its opinion on issues and draft laws suggested by the president and the government.
Supreme Constitutional CourtThe Supreme Constitutional Court decides cases in which the constitutionality of a law or regulation is challenged. The judges on the court have been accused of being Mubarak appointees, though the current president, Maher al-Beheiry, was selected by the court from among the three most senior members, in line with a law amended by the Scaf last year.
Nathan Brown of the Carnegie Endowment for International Peace says the court's autonomy varied considerably under Mr Mubarak, and that its reputation and record for independent action has declined over the past decade. "What justices on the SCC tend to share, despite diverse orientations, is a strong sense of mission to the law and abstract constitutional principles," he adds. "In a sense, their attitude is analogous to that of the Scaf, though the comparison might offend some of them: senior judges, like senior generals, see themselves as guardians of the public interest and the interests of the state, and therefore as above politics, democratic mechanisms, and accountability."
President Mursi's constitutional declaration of November 2012 challenged the authority of the SCC, removing its power to rule on the legitimacy of any laws and decrees issued by him until a new constitution has been ratified and parliamentary elections held, and also stopping it dissolving the constituent assembly and Shura Council.
MilitaryAlthough President Mursi regained the executive and legislative powers claimed by the Supreme Council of the Armed Forces (Scaf) in August 2012, the military is still the most powerful government entity. Many say it operates like a state within a state.
The three presidents who ruled Egypt before the revolution, along with their defence ministers, all had military backgrounds and bestowed unrivalled powers and benefits on the armed forces, particularly Hosni Mubarak.
The military has about 460,000 personnel and possesses vast land holdings and businesses. It plays a social role, providing employment and a sense of national identity to many Egyptians. But its pervasive influence has long been the subject of fierce criticism.
Estimates vary as to the size of military-owned industries - they account for around 8%-40% of Egypt's gross national product - but since their revenues are a state secret, along with the military's budget, it cannot be known for certain. The companies not only produce military hardware, but also products and services for the domestic consumer economy.
The military's influence extends far beyond its own institutions and businesses. The majority of provincial governors are retired army officers and many of the big civilian institutions and public sector corporations are run by former generals, including the three main land-developing authorities. The military is also involved in major infrastructure projects.