The dismissal of Egypt's Director of Intelligence Murad Mowafy on Wednesday was the culmination of recent disagreements, but his performance in the run-up to the militant attack on Sinai was the final straw, a source close to the presidency has told Ahram Online.
The source, speaking on condition of anonymity, said there had already been disputes between the intelligence head, the military council and President Morsi's office, but that Mowafy's performance before Sunday's killing of 16 border guards in North Sinai by militants had been the major reason for his replacement.
"At a time when confirmed intelligence had come from Israel warning Egypt of a security crisis, the intelligence chief had invited all the tribal heads in Sinai to have Iftar. [He did this] rather than keeping them in position so he could attain information," said the source.
Mowafy said earlier in the week he had done all he could to prevent the attack, and that his office had passed the intelligence to the president.
His comments were read by some as a suggestion that President Morsi bears some responsibily for Sunday's events by not reacting quickly enough.
Mowafy's dismissal has been met by relief in some quarters, with several insiders critical of his past performance.
"Despite Mowafy's experience in Sinai [where he was the director of military intelligence and governor before becoming head of the Egypt's General Intelligence Service], he did not benefit from his wide-ranging internal and external relationships," complained one intelligence source.
"When it came to managing [the service] Mowafy was not successful for two specific reasons. He was not capable of imposing tight discipline, and he only reacted to events and did not initiate actions."
This non-interventionalist approach explains why security forces failed to penetrate jihadist factions in Gaza to obtain vital intelligence about attacks, as Israel claims to have done, the source said.
Mowafy was appointed head of intelligence by Hosni Mubarak in early February 2011 after the soon-to-be-deposed head of state appointed his former spy chief Omar Suleiman as vice-president.
Less than three months later, Mowafy was credited with brokering a fragile reconciliation between the Palestinian factions Fatah and Hamas.
But the intelligence chief's relationship with Field Marshall Tantawi, head of the Supreme Council of the Armed Forces (SCAF) and defence minister, was an unhappy one, according to insiders.
The decision to dismiss Mowafy was personally approved by Tantawi, the intelligence source claims, adding that Mowafy did not inform the military council of the Sinai warning.
"This was not the right thing to do -- the military needs to be informed of such developments to be able to deal with it on the ground," the source said.
"The attack was a big blow against the armed forces in the area. It is supposed, more than anything else, to secure Egypt's borders."
Egypt's head of General Intelligence is traditionally chosen by the president, and has in the past been recruited from outside GIS ranks.
President Morsi appointed Major General Raafat Shehata as Mowafy's successor. Shehata had served as undersecretary of the GIS since the beginning of the year.
Described by colleagues as a respectable and capable operator, the new head of intelligence is a little-known figure.
Shehata most high-profile appearance was during the release of imprisoned Israeli soldier Gilad Shalit in October 2011.
Shalit was released by Hamas after a prisoner swap deal between Hamas and Israel, which Shehata was said to have helped negotiate.