Former Egyptian Prime Minister Ahmed Shafiq has withdrawn from the running for the country's presidency, saying he is the wrong person for the job.
Mr Shafiq announced his candidacy in November in the United Arab Emirates (UAE), where he fled after losing the 2012 election to Mohammed Morsi.
Within days he was detained by the UAE, which supports his rival, the incumbent President Abdel Fattah al-Sisi.
Mr Shafiq was widely seen as the most serious challenger to Mr Sisi.
He was deported by the UAE following his arrest and his family reported being unable to contact him after his arrival in Egypt.
Hours later, he gave an interview on Egyptian television in which he denied speculation he'd been kidnapped and said he was reconsidering his decision to run against Mr Sisi.
His family raised concerns of foul play, and alleged he was being held against his will at a Cairo hotel.
On Sunday, Mr Shafiq confirmed in a post on Twitter that he would not run, saying he felt he was not the ideal person to lead the country.
"My absence of more than five years perhaps distanced me from being able to very closely follow what is going on in our nation in terms of developments and achievements despite the difficulty of the conditions," he wrote.
"I have seen that I will not be the ideal person to lead the state's affairs during the coming period. Thus I have decided not to run in the upcoming 2018 presidential elections."
A former air force commander and aviation minister, Mr Shafiq stood for president in 2012 but lost narrowly to Mr Morsi, who subsequently issued an arrest warrant for him on corruption charges.
Mr Shafiq fled to the UAE. Mr Morsi was later ousted by the military and replaced in 2014 by Mr Sisi , while Mr Shafiq was acquitted of the corruption charges.
Separately, another potential presidential candidate, Colonel Ahmed Konsowa, was arrested in December after announcing plans to run.
He was sentenced by a military court on 19 December to six years in prison. He was sentenced for "stating political opinions contrary to the requirements of military order", his lawyer Asad Haykal, was quoted as saying by AFP news agency.
The Al-Mesryoon newspaper said he was arrested for an investigation into "publishing a politically-affiliated video and abuse of his military post".