Ahmed Shafik, a former Egyptian prime minister, has said he will not stand for president in the country's upcoming presidential elections.

The 76-year-old had previously announced his plan to run in an exclusive video message to Al Jazeera.

"I saw that I will not be the ideal person to lead the state during the coming period," a statement posted on Shafik's Twitter account read on Sunday.

"Thus I have decided not to run in the upcoming 2018 presidential elections."

Shafik was seen as one of the few people who could potentially challenge President Abdel Fattah el-Sisi in the election, scheduled to take place in March.

The New York Times quoted one of Shafik's lawyers, who asked not to be named, as saying that the Egyptian government had forced him to withdraw by threatening to investigate previous charges of corruption against him.

The lawyer's comments were confirmed by recordings of phone calls obtained by the New York Times, made by an Egyptian intelligence officer to a presenter of a TV show that had recently interviewed Shafiq.

"If he decides to be with us, we will consider him one of the former commanders of the Egyptian armed forces. Did you understand?" officer Ashraf al-Khouli said in the recordings.

"If he doesn't agree we will curse his family," Khouli added.

From Egypt to UAE and back

Shafik was prime minister for one month in 2011, during that year's Arab Spring uprising.

After losing a 2012 election to Mohamed Morsi, Shafik fled to the United Arab Emirates. While in Abu Dhabi, he was placed on trial in absentia in Egypt and found guilty of corruption charges.

He was later acquitted, clearing his path for a potential return to Egypt.

He did so last month after being deported from the UAE - a strong Sisi supporter - for reasons that are still unclear.

With his whereabouts unknown upon his arrival in Egypt's capital, Cairo, Shafik's family members feared he had been "kidnapped" by Egyptian authorities.

However, Shafik denied this in a subsequent TV appearance.

A former air force commander, Shafik was previously thought of as planning to go on a European tour to campaign for his presidential bid among the Egyptian diaspora.