Two years after the army deposed president Mohamed Morsi, Egypt is roiled by brazen Islamic State group attacks in the Sinai Peninsula and brutal government repression that has killed hundreds.
Militant attacks have persisted since the then army chief and now President Abdel Fattah al-Sisi ousted Morsi on July 3, 2013, after mass street protests against the Islamist's single year of divisive rule.
This week's assassination of state prosecutor Hisham Barakat in a Cairo car bombing, followed by spectacular IS attacks that killed dozens in the Sinai, underlined the lack of security and stability despite a wide-ranging crackdown.
Hundreds have been killed, tens of thousands detained and hundreds more sentenced to death after speedy trials in the crackdown targeting Morsi supporters.
Morsi and several leaders of his Muslim Brotherhood movement are among those to have been handed the death penalty.
Jihadists led by IS have killed scores of troops, mostly in the Sinai, challenging Sisi's efforts to restore security and economic stability in the biggest Sunni Arab country.
On Wednesday, the military deployed F-16 warplanes to bombard IS jihadists who battled troops in a North Sinai town after launching a surprise dawn attack on army checkpoints.
Dozens were killed in what was IS's boldest attack yet in the strife-torn Sinai, with militants taking over rooftops and firing rockets at troops.
The army said in a video depicting the attack that militants had pinned IS flags on some buildings to "show that the terrorists had taken over the town," but their attempt was thwarted.
Attacks by insurgents multiplied after the overthrow of Morsi, with Egyptian jihadist group Ansar Beit al-Maqdis pledging allegiance to IS last November.
"There is a complete political failure at all levels amid a return of repression, arbitrary arrests and killings," said activist Mohamed Nabil from the April 6 youth movement that spearheaded the 2011 uprising against ex-president Hosni Mubarak.
– Weary Egyptians back Sisi –
The crackdown overseen by Sisi initially targeted Morsi's supporters — a police assault on two pro-Morsi camps in Cairo weeks after his overthrow killed hundreds.
The crackdown was rapidly expanded to include the jailing of secular activists who had not only revolted against Mubarak but backed Sisi in ousting Morsi.
Rights groups accuse the authorities of using the judiciary to suppress dissent.
"The Egyptian authorities have shown that they will stop at nothing in their attempts to crush all challenges to their authority," said Hassiba Hadj Sahraoui of Amnesty International.
Barakat's murder and Wednesday's IS attacks infuriated Sisi, who called for fast-track executions of those on death row.
On Wednesday the cabinet passed an anti-terror law to "achieve swift justice and revenge for our martyrs".
Analysts said the government sees most opponents as supporters of the now blacklisted Brotherhood.
"And because many Egyptians are weary of political tumult and frightened by an upsurge of terrorist attacks within Egypt's major cities, they are largely supportive of this crackdown," said Eric Trager of think-tank The Washington Institute for Near East Policy.
– Economic concerns –
The other major challenge Sisi faces is how to revive the economy.
His government's aim is to achieve annual gross domestic product (GDP) growth of seven percent for an economy traditionally driven by tourist revenues.
The vital sector has plummeted, however, with last year's 10 million visitors sharply down on 2010 when 15 million tourists thronged the country, lured by its archaeological sites and Red Sea resorts.
Signs of a recovery are visible, but economists said a fundamental change is needed in the government's thinking.
Sisi hosted an international conference in March, which attracted investment deals worth more than $36 billion. He is also banking on the new $9 billion Suez canal expansion project scheduled to be inaugurated on August 6.
The project is part of an ambitious plan to develop the zone around the canal into an industrial and commercial hub, with a focus on shipping.
The expansion is expected to more than double annual Suez revenues, to $13.2 billion in 2023.
"I am bullish on developments around the new Suez Canal, but I am looking forward to seeing a programme that would have a number of other infrastructure development projects to help job growth," said Angus Blair, chief executive of the Cairo-based Signet think-tank.
Double-digit inflation and a budget deficit of 12 percent of GDP also remain key concerns.
"Current economic growth is about five percent per annum. What is needed is seven to eight percent of growth, given the population growth of 2.6 percent per annum," Blair said.