Egyptian Prime Minister Ahmed Shafik  in Cairo on February, 2011

Story highlights

Ahmed Shafik was Hosni Mubarak's last prime minister

He's a former air force officer with deep ties to the establishment

His campaign is using Facebook and YouTube to show he's a man of the people

He successfully appealed against a ruling barring him from running

CNN  — 

Ahmed Shafik was Hosni Mubarak’s last prime minister. Now he hopes to become Egypt’s first democratically elected president.

He is running against Mohamed Morsi of the Freedom and Justice Party, the political arm of the Muslim Brotherhood, in the presidential runoff election that begins Saturday.

Like Mubarak, Shafik is a former air force officer with close ties to Egypt’s powerful military, “the quintessential candidate of the counter-revolution,” in the words of Khaled Elgindy, a visiting fellow at the Brookings Institution in Washington.

Shafik, who briefly served as prime minister in the waning days of Mubarak’s presidency, is one of two candidates to advance from the country’s first round of presidential voting in May.

The runoff election between Shafik and Morsi will decide who will become Egypt’s first democratically elected president.

On Thursday, Egypt’s highest court ruled cleared the way for Shafik to participate in the runoff after invalidating a law that barred former members of Mubarak’s regime from running in the election. The ruling came the same day the court dissolved parliament after declaring the constitutional articles that regulated parliamentary elections were invalid.

Despite his ties to Mubarak’s rule, Shafik, 72, is trying to portray himself as a man of the people.

In the weeks leading up to the May election, his presidential campaign used all the tools of the Internet age to get his message out, with a website, a YouTube channel, a Facebook page and a Twitter feed.

One of his many YouTube videos shows him dressed in a black T-shirt, meeting supporters and pinching the cheeks of a cute little boy. His campaign posters portray him in more professional attire, in a suit and tie, just a hint of an avuncular smile around his lips and the eyes behind his rimless glasses.

And his Facebook page shows off a photo of him as a young man with Egyptian President Anwar Sadat, who won a Nobel Peace Prize for making peace with Israel before he was assassinated for the historic outreach.

In the decades of Mubarak rule that followed, Shafik rose through the ranks.

As Egyptians rose up against Mubarak in January 2011, the man who had led the country so long that he was nicknamed “Pharaoh” shuffled his government ministers one last time, promoting Shafik from civil aviation minister to prime minister.

Mubarak was toppled less than two weeks later, but Shafik remained in power for a few weeks longer, saying he and his government would report to the military council that took control of the country after Mubarak resigned.

Shafik himself resigned on March 3, 2011, after a brief effort to keep Mubarak and his allies from being prosecuted after their ouster.

As a result, Shafik is supported by many of those who lost out as a result of Mubarak’s removal from power, said Omar Ashour, director of Middle East studies at the University of Exeter in England, who is currently in Cairo.

His supporters include “the powerful ones, a collection of businessmen and generals,” said Ashour, a visiting scholar at the Brookings Institution in Doha, Qatar.

Some members of the Supreme Council of Armed Forces may also back him “because he might maintain the status quo,” Ashour said, doubting that Shafik could win a popular vote.

“There’s no way he would get in without (vote) rigging and, if that happened, I think there would be the possibility of another revolution,” Ashour said.

Ashour plays down the chance of that happening, however, saying it would be too dangerous for the Supreme Council of Armed Forces, given the current volatile situation in Egypt.

Shafik has been the target of particular anger from the Muslim Brotherhood, the country’s venerable Islamic opposition movement that won the largest share of the seats in parliamentary elections after the revolution.

In April, the Brotherhood called for a mass protest in Cairo’s Tahrir Square, the symbolic heart of the Egyptian revolution, against the presidential candidacies of Shafik and Omar Suleiman, Mubarak’s longtime head of intelligence.

Both were disqualified from running, but Shafik successfully appealed the ruling.

CNN’s Laura Smith-Spark contributed to this report.