CAIRO (Reuters) - President Mohamed Mursi sacked the intelligence chief on Wednesday and Egyptian aircraft hit targets on the border with Israel in the biggest assault in the area in nearly 40 years after a deadly attack by militants on Egyptian border police.
It was unclear how far Mursi - who must accommodate the powerful army at home and reassure Israel that, as Egypt's first Islamist president, he will maintain stable relations - had expanded his authority in response to Sunday's attack.
But in a major shake-up, he sacked intelligence chief Mourad Mwafi and announced other changes in security appointments.
He has also promised to restore calm to the Sinai region after militants killed 16 Egyptian guards on Sunday and then stormed through the border before being killed by Israeli fire.
It was the bloodiest attack on security forces in Sinai since Egypt made peace with Israel in 1979.
Israel, which has been urging Egypt to deal with a growing threat on its southern flank, voiced approval of the security sweep.
Islamist militants opposed to the existence of Israel have stepped up attacks on security forces on the border since the overthrow of president Hosni Mubarak last year.
Many live among Bedouin tribes angry about being neglected by Cairo; they are often Bedouin themselves but follow a stricter interpretation of Islam, while also eschewing the political Islam espoused by Mursi in favour of militant tactics.
Early on Wednesday, Egyptian aircraft struck at targets near the border with Israel and troops raided villages, army officials and witnesses said, in the biggest military assault in the area since their 1973 war.
Egypt's military leadership said ground and air forces had begun to restore stability in Sinai.
"The forces were able to execute the plan successfully. The forces will continue the plan and calls on tribes and families of Sinai to cooperate in the restoration of security," it said.
Mursi, who took office in June, appointed Mohamed Shehata as acting head of intelligence and sacked the governor of the north Sinai region, presidency spokesman Yasser Ali told reporters.
Ali said Mursi also asked the head of Egypt's armed forces, Field Marshal Hussein Tantawi, to appoint a new head of military police, and named a new head of the presidential guard.
The changes were announced after Mursi held a national security meeting that brought together Tantawi as well as the prime minister and interior minister.
Analysts said it was unlikely Mursi would have been able to make the changes without the approval of the army, which has kept a tight grip on security policy since the overthrow of Mubarak.
However, a security source said that Shehata, the new acting intelligence chief, had a reputation under Mubarak for being less of a regime loyalist and had been denied promotion as a result.
Explaining the changes, spokesman Ali said Egypt was going through a critical phase and it was necessary to protect "the Egyptian revolution and the Egyptian will".
The fallout of Sunday's attack was the first major test of how Mursi - from the Muslim Brotherhood - would balance the need to maintain stable ties with Israel with his political affinity with the Islamist Hamas movement ruling the Gaza Strip that borders both Israel and Egypt.
Egyptian officials said the gunmen arrived via tunnels used to smuggle goods into Gaza since the territory was cut off by Israel. Egypt began work to seal them off on Tuesday, upsetting Gaza residents who had expected better relations with Cairo after Mursi's election.
Israel has long accused Palestinian militant groups of crossing from Gaza to Egypt to team up with local militants with the aim of attacking Israel's long border. Last August armed infiltrators killed eight Israelis on the Egyptian frontier.
Egypt's military response - which focused on Shaikh Zuwaid, a mud-brick settlement that relies heavily on profits from smuggling goods and people into Gaza - appears to have reassured Israel.
"What we see in Egypt is a strong fury, a determination of the regime and the army to take care of it and impose order in Sinai because that is their responsibility," a senior Israeli defence official, Amos Gilad, said on Israel Radio on Wednesday.
Troops also entered al-Toumah village, 20 km (15 miles) to the south, acting on information that militants were staying there, army commanders in Sinai told Reuters. One said 20 militants were killed. A villager said he saw helicopters chasing vehicles out of al-Toumah and heard rocket fire.
Mubarak's government worked closely with Israel to secure the frontier region until he was toppled 18 months ago.
Mustapha Kamel Al-Sayyid, a professor of political science at Cairo University, said the situation would now force Mursi's administration to deepen contacts with Israel over security, a step he had hoped to avoid, and restrict contacts with Hamas.
The Hamas prime minister of Gaza, Ismail Haniyeh, said there was no evidence Gazans were involved in the latest violence.
(Additional reporting by Yusri Mohamed in al-Arish, Ari Rabinovitch in Jerusalem, Nidal al-Mughrabi in Gaza; Writing by Myra MacDonald and Tom Pfeiffer; Editing by Philippa Fletcher)