The general command of the Egyptian armed forces, in a video posted on Facebook, accused Anan of crimes including forgery. But his detention does suggest how far el-Sissi is willing to go to clear the field of challengers - even if doing so means crossing senior figures in the military establishment that is his political bedrock.
Human rights lawyer Khaled Ali said Wednesday he is quitting the race to become Egypt's president, citing reasons including the arrest of some of his election campaign activists and a tight timetable.
Ali, a prominent socialist, had entered the race as a symbol of Egypt's leftist revolutionary politics, but on Wednesday he told a press conference packed with supporters that "the opportunity for hope in this presidential election has gone". His campaign was halted in its tracks.
Annan was also arrested by the military Tuesday, but his campaign made no mention of that.
But the lawyer had faced nearly insurmountable challenges from the start, initially in the form of a court case accusing him of making "an obscene gesture" outside a Cairo court.
On Tuesday evening, Egypt's military prosecutor Mohamed al-Roweiny announced that media coverage on the investigation into the case of Sami Anan's presidential bid and military status has been banned.
Tesla Driver, Passed Out Drunk, Tells Highway Patrol Autopilot Was in Charge
No one was hurt, but the accident is being investigated by a team from the National Highway Traffic Safety Administration (NHTSA). It also announced that it hoped to deploy test vehicles with no steering wheel or pedals as soon as next year.
The statement also accused Sami Anan of forging paperwork that showed his military service had ended, which the Armed Forces denies.
"The way the state dealt with Anan is of greater concern than whether his bid was actually a violation of military law", said Mr Ali's campaign spokesman Amr Abdel Rahman.
Anan served as armed forces chief of staff from 2005 until he was retired by Morsi in 2012 and analysts said his candidacy might attract Egyptians nostalgic for the relative stability of the Mubarak era.
In a brief statement, Annan's campaign said it was suspending its activity indefinitely "out of fear for the safety and security of all citizens who dream of change". The islands became an unexpectedly hard issue for Mr. Sisi because they aroused a wave of rare public anger in a country where public protest is largely outlawed.
He also took the unusual step of appealing to the military and state institutions to remain neutral in the election, saying they should not be biased in favor of el-Sissi.
Morsi, a leader of Egypt's Muslim Brotherhood group, was himself ousted in mid-2013 in a bloody military coup. Under el-Sissi, links to the Brotherhood are grounds for prosecution. After announcing his candidacy from self-imposed exile in the United Arab Emirate, the former Egyptian Prime Minister Ahmed Shafik was returned to Cairo by Emirati authorities.