Egypt's President Mohamed Morsi has fired his spy chief Murad Muwafi in a major shake-up of military and intelligence ranks extending to the head of the Republican Guard and the governor of North Sinai.
Wednesday's decision comes several days after a deadly ambush in Sinai killed 16 soldiers, prompting an unprecedented military crackdown in the peninsula, but Morsi's spokesman did not say whether the attack had prompted the changes.
Morsi also ordered Field Marshal Hussein Tantawi, the defence minister, to replace the head of military police Hamdi Badeen, his spokesman Yassir Ali said in a televised statement on Wednesday.
Morsi appointed Mohammed Rafaat Abdel Wahad Shehata as the interim head of General Intelligence.
Earlier on Wednesday, Muwafi, himself a former governor of North Sinai, issued a rare public statement saying that his agency had forewarning of the weekend attack that killed the soldiers.
But he said the intelligence did not specify where the attack would take place and he had passed it on to the "relevant authorities", adding that his powerful agency's role was only to collect information.
The shuffle extended to Abdel Wahab Mabruk, the governor of North Sinai where the attack took place.
Morsi is likely to have reached the decisions with the military, which ruled the country between President Hosni Mubarak's ouster in February 2011 and Morsi's inauguration as his successor in June.
The head of the Presidential Guard, the director of Security in Cairo and the director of Central Security Forces were also fired.
Al Jazeera's Sherine Tadros, reporting from Cairo, said that it was clear that Morsi was trying to take control of the situation.
She said the dismissals were not just about Sunday night's border attack, but that it was also about the funerals on Tuesday of the 16 soldiers, which the president did not attend because of security reasons.
"That's something that really upset a lot of people here who saw it as a national tragedy. He's definitely trying to show them who's boss."
The dismissed officials were not appointed by Morsi but rather by either the Supreme council of Armed Forces or Mubarak, said our correspondent.
"There has been this struggle between these agencies and the new president... who is trying to say that this is a new era. An era where there will be accountability, as opposed to the years under Mubarak where there was a spy chief that survived many terror attacks including ones similar to this one in the Sinai," she said.
Air strikes in Sinai
The developments coincided with air strikes in the Sinai region close to the border with Gaza, which the state-run Ahram news website said left more than 20 people dead.
The air strikes on positions in the town of Sheikh Zouaid followed the deaths of 16 border guards at the weekend in an attack by gunmen whose identities are yet to be determined.
Witnesses in Sheikh Zouaid, about 10km from Gaza, said they saw two military jets and heard sounds of explosions. Other witnesses in a nearby area said they saw three cars hit.
"We have succeeded in entering al-Toumah village, killed 20 terrorists and destroyed three armoured cars belonging to terrorists. Operations are still ongoing," an army commander told the Reuters news agency.
The strikes followed clashes between armed men and security forces at several security checkpoints overnight in the Sinai region.
Armed men opened fire on checkpoints in al-Arish and in the nearby town of Rafah on the border with Gaza, according to a reporter for Reuters and state media.
Six people were injured in the attacks late on Tuesday night, including two police officers, three army soldiers and one civilian, sources told Al Jazeera. The civilian is said to be in critical condition.
A cement production company in Sinai, which belongs to the military, was also attacked. Two gunmen suspected in that attack have reportedly been arrested.
Exchanges of gunfire continued late into the night, state news agency MENA said, adding that security forces had closed the road where the assault took place.
'Armed tribes stronghold'
Al Jazeera's Jamal Elshayyal, reporting from the city of al-Arish, said: "Over 48 hours since that audacious and shocking attack on the Egyptian military post here in Sinai, it seems that the army has decided to hit back if you will."
"We've have heard that helicopters from the airforce, and... tanks and other personnel carriers moved towards an area in Sinai which is essentially being seen as the stronghold of many of the armed tribes and armed assailants," he said.
"The military it seems has decided to strike back against the people they believe were behind these attacks."
Egyptian security officials say it is the first time that the army has fired missiles in Sinai since the 1973 war with Israel to recapture the peninsula.
Lawlessness in the rugged desert region bordering Israel has spread since the fall of Mubarak in an uprising 18 months ago and the political instability that has followed.