The army's ouster of Egypt's first democratically elected civilian president, Mohamed Morsi, in July 2013 led to a general clampdown under the regime of Abdel Fattah al-Sisi.
Here is a summary.
Carnage in Cairo
On August 14, 2013 security forces move in on two pro-Morsi protest camps where thousands of Islamists have for six weeks been demanding the reinstatement of the ousted ex-leader, who hails from the Muslim Brotherhood.
Pro-Morsi mobs attacked police stations and Christian properties across the country and more than 40 policemen were killed.
At least 700 people die in what Human Rights Watch calls "one of the largest killings of demonstrators in a single day in recent history" in Egypt.
A day later the police are authorised to fire live bullets on demonstrators who attack public buildings and security forces.
According to Amnesty International, in seven months at least 1,400 people are killed in the crackdown on protests.
Tens of thousands of Morsi's supporters are arrested.
Mass trials of Morsi supporters
In March 2014 mass trials sentence 529 people to death on charges including murder and attempted murder of police. The United Nations denounces the mass sentencing as a breach of international human rights law.
In April another 683 suspected supporters of Morsi are sentenced to death, including the head of the Muslim Brotherhood, Mohamed Badie.
Hundreds of sentences are later commuted to life in prison.
In June 2015 a court upholds a death sentence handed to Morsi for plotting jailbreaks and attacks on police during the 2011 uprising that unseated longtime president Hosni Mubarak.
Nearly 100 people, including Badie, are sentenced to death.
In 2016-2017 the appeals court annuls hundreds of death sentences, including some of those pronounced against Morsi and leaders of his Brotherhood.
2011 revolt activists jailed
In February 2015, 230 activists, including some who were involved in the 2011 revolution, such as the leader Ahmed Douma, are sentenced to life. Thirty-nine minors are sentenced to 10 years. The heavy sentences are condemned by the United States and the European Union.
Dozens of non-Islamist and leftist activists are also jailed, accused of breaching a controversial law banning demonstrations.
In January 2017 a leading figure in the 2011 revolt, Ahmed Maher, is released after three years in prison on charges that he organised unauthorised protests. He remains under judicial supervision.
'Crushing' civil society
In May 2017 Sisi lays down a contentious new law to regulate non-governmental organisations that eight groups, including Human Rights Watch, say "will crush civil society".
The new law requires that a "national authority", including representatives of the army and intelligence service, oversees the foreign funding of Egyptian NGOs and the activities of foreign ones.
Media under surveillance
Egypt is in 161th place out of 180 countries in the Reporters Without Borders 2017 press freedom ranking.
At least 30 journalists are in jail, according to Reporters Without Borders, and around 500 internet sites have been blocked in less than a year.
Among those targeted are Qatar's Al-Jazeera channel, the liberal website Mada Masr and the Daily News Egypt newspaper.
Western media are accused of tarnishing Egypt's image overseas.
Most of Sisi's rivals in this month's presidential election have been sidelined or withdrawn.
The most credible, former military chief of staff Sami Anan, is detained in January shortly after announcing his candidacy. The military says he is still enlisted and has no right to run.
Former army general and prime minister Ahmed Shafiq withdraws his candidacy after meeting with state officials on his return from exile in the United Arab Emirates.