One of Egypt's top politicians, the former prime minister Ahmed Shafik, has pulled out of the country's upcoming presidential election saying it will be fixed in favour of the army chief.

In a leaked recording broadcast by Al Jazeera on Thursday, Shafik described the forthcoming poll as "a comedy show" that no candidate other than Field Marshal Abdel Fattah el-Sisi has a chance of winning.

Shafik had previously said he would back Sisi if he ran for the presidency. In the recording, however, he says: "I know very well they will fix all the ballot boxes. I have taken myself out of this loop because the election is going to be a farce."

"Of course whether other candidates withdraw will depend on the nomination of Sisi. I said if he’s going to run in the presidential election I will not run but I will get my papers ready (and) if he is going to run I will not submit them.

"They will fix everything for him… this is going to be a comedy show," he said.

Sisi, who led the army's removal last year of Mohamed Morsi from the presidency, has yet to announce his candidacy and the interim president, Adly Mansour, has yet to set a date for the election.

Shafik narrowly lost his last presidential bid, against Morsi, who was elected in 2012. He was also prime minister in Hosni Mubarak's cabinet in January 2011, but resigned a month later as protests intensified Mubarak's rule.

Another politician, Sami Anan, announced his withdrawal from the presidential race on Thursday. It means Sisi would face only one significant rival in the poll should he enter - the left-wing politician Hamdeen Sabahi.

Anan, the former chief of staff of Egypt's military, said his decision was "rooted in the nation's highest interests" and "out of the realisation of the dangers facing it".

Anan had earlier this week claimed to have survived an assassination attempt by unknown assailants, an allegation dismissed by the Ministry of Interior as "mere election publicity".