CAIRO // Mohammed Morsi's presidency is under scrutiny as he faces security tests from militant groups in Sinai and protests against an anti-Islam film.
One of the hallmarks of the Hosni Mubarak regime was maintaining security through brutal repression and the question now is which tactics Mr Morsi will use to keep the country calm, while not violating the human rights of protesters and political groups.
For Mr Morsi, the task is made all the more difficult because he won the presidential election in part through his Islamist credentials. But he - as an Islamist - was jailed by the old regime for being part of the then banned Muslim Brotherhood, which means he needs to respond to the challenges in a sensitive manner.
The protests against the film clip from Innocence of Muslims, which started in Egypt on Tuesday and spread to 20 countries by Friday, iterated the challenge. Mr Morsi has attempted to walk a fine line by condemning the blasphemy of the film, which portrayed the Prophet Mohammed as a philanderer and fraud, while also calling for peaceful protests and describing the attacks on US embassies across the Islamic world as being against the teachings of the Quran.
"He is trying something innovative now because he doesn't have the same reputation as Mubarak had, of someone who always uses the state security forces to maintain security," said Omar Ashour, director of Middle East studies at Exeter University in England and a visiting fellow at the Brookings Doha Center. "Part of the approach is to allow religious leaders to have some room to speak to people and calm the situation down, but he's up against groups who want to portray him as a new Mubarak."
Mr Morsi has opted for a different tactic to secure Sinai. After assailants last month killed 16 border guards and attempted a second attack in Israel, the Egyptian security forces cracked down on groups across North Sinai. But within days, Mr Morsi backtracked and ordered the security forces to stop arresting people and release some of the detainees.
That was due, in part to, a group of former militants who had been jailed alongside Mr Morsi that travelled to Arish to hold a meeting with Sinai religious leaders and groups.
Magdy Salem, a former senior member of Al Jihad, who was released after 18 years imprisonment last year, led the delegation from Cairo. He said his group was not formally asked by the president to go, but that they had asked permission from the presidency and received the green light.
"Together with our brothers in Sinai, we condemned the attacks on the Egyptian soldiers," he said. "We believe there is a conspiracy to damage the reputation of the Islamists through attacks like these."
One of the men released after the meeting was Selmi Abu Suleiman, 60, a house builder, who said that officers barged into his house at dawn several days after the attacks and accused him of being the "Bin Laden of Sinai". He denied any involvement with radical groups.
But the limits of Mr Morsi's new approach can easily be found in the majilis of Hamdeen Abu Faisal, a popular religious cleric in the city of Sheikh Zuwaid in North Sinai. He insisted that the attacks on the Egyptian soldiers had the marking of "foreign spies" because the military was not considered a valid target for militants.
But he added that waging a war against Israel was a vital obligation of the Palestinians.
"We must not let attacks be launched on Israel from Egypt and Egyptians should not attack Israel, but we must do everything we can to help our brothers in Palestine to fight the Israelis," he said.
His words represented a tacit approval of the weapons smuggling and economic assistance to militant groups in the Gaza Strip, who launch periodic missile attacks into Israel and use tunnels at the border area in Rafah to ferry in ammunition and other supplies.
The Egyptian Army has said it is securing the region through the continuing "Operation Sinai", with 32 "criminal elements killed and another 38 arrested, including "non-Egyptians". But a military spokesman, Colonel Ahmed Mohammed Ali, also struck a more even-handed note in discussing the longer battle to secure Sinai.
"The operation will continue until its goals have been achieved ... These are not just military goals but also developmental goals for the Sinai," he told reporters last week.
The latest attack in Sinai came on Friday, when Islamist militants waving black banners and shouting "God is great" stormed an international peacekeepers' base and battled troops, wounding four Colombians.
Back in Cairo last week, Mr Morsi was forced to retreat to the standard tactics of controlling protesters through black-clad central security officers, erecting a 4.5 metre concrete wall blocking access to the US Embassy and volleys of tear-gas canisters. But the military were not called in.
However, he was also able to coordinate with religious leaders and groups in a way that would have been more difficult during the Mubarak era.
The Muslim Brotherhood, which though separate from the presidency is seen as moving lock-step with his initiatives, attempted to calm the furore in Tahrir Square by cancelling at the last minute a large protest it had called for against the film clip.
The imam of Omar Makram mosque in Tahrir Square, Mazhar Shahin, told a gathering of hundreds in his Friday sermon that the presidential office had told him of a planned conference of religious leaders, heads of state and senior lawyers that would draft an international agreement to prevent blasphemy against religious symbols. It was a sign of the significant outreach effort of the presidency in the religious community.
Eslam Hamdy, 24, a tourism worker listening to the sermon, said afterwards that Mr Morsi was succeeding in keeping the calm.
"Look at the square. It's fairly empty. It could have been much worse."