Shortly before the tweet, the armed forces had announced in a statement broadcast on television that Anan - who was President Abdel Fattah Al Sisi's rival in the election, is under investigation for forging documents and violating military rules.
El-Sissi, himself an ex-general, is considered virtually certain to win re-election in the March 26-28 balloting.
With one would-be candidate after another dropping out of the race, analysts have said the election could end up being much like the one-candidate referendums for president that took place during decades of authoritarian rule in Egypt, a country of about 100 million people.
Rights lawyer Khaled Ali has said he will still run, but he might be disqualified over a legal case against him.
Anan's official campaign coordinator Mahmoud Refaat wrote on his Twitter on Tuesday that Anan had been arrested after a statement was released by the Armed Forces, which said that Anan will be investigated over "forgery" charges. The next hearing is scheduled for March 7.
"This goes far beyond these charges", said Mostafa Elshall, the director of Anan's office and a close friend, suggesting the measures were meant to deter Anan's presidential bid.
Annan was also arrested by the military Tuesday, but his campaign made no mention of that.
First camp for Rohingya refugees returning to Burma will open next week
The clash is feared to hamper projected repatriation of Muslim Rohingya refugees from neighboring Bangladesh. Officials plan to start the repatriation process from January 23.
The circumstances of his arrest were not clear, but there were unconfirmed reports that he was arrested by military intelligence personnel while being chauffeured in Cairo en route to his campaign headquarters.
Egyptian law requires former army officials to end their service and receive permission from the military before they can run for political office.
His detention came before the armed forces' statement, added Geneina, the former head of the Central Auditing Authority (CAA) who was sacked by Sisi in 2016 after he was accused of exaggerating the cost of corruption. His candidacy also could have drawn a sizable protest vote from Egyptians struggling under high prices resulting from el-Sissi's ambitious reform program to overhaul the battered economy.
His arrest comes after two other potential candidates dropped out of the race this month, with one, former prime minister Ahmed Shafiq, saying he had realised he was "not the ideal candidate to lead the country's affairs in the coming period" and the other, former MP Mohammed Anwar Sadat, saying he saw no possibility of a fair race against Mr El Sisi.
Mr Sisi came to power after leading a popularly backed military coup in 2013 against his elected Islamist predecessor, Mohamed Morsi, a leader of the Muslim Brotherhood. Authorities accuse the group of taking up arms against the government.
Ahmed Shafik, a former prime minister and air force chief, abandoned a bid this month, saying that after several years living overseas he was out of touch with Egyptian politics. Former lawmaker Mohammed Anwar Sadat previously announced he was dropping out of the race, partly out of fear for the safety of his supporters.
- English Premier League Report: Southampton v Tottenham Hotspur 21 January 2018
- Bitcoin falls below $10000 as sell-off continues
- Ed Sheeran gets engaged to fiance Cherry Seaborn
- NBA All-Star Game Reserves Announced
- Arsene Wenger's Pierre-Emerick Aubameyang comments upset Borussia Dortmund
- Kerber thrashes Sharapova to reach fourth round
- Who Bears the Blame for a Government Shutdown?
- LeBron James writes congratulatory message to himself on Instagram
- Microsoft unveils $200 Windows 10 laptops for schools
- Facebook to Have Users Decide What Is 'High Quality' News