(CNN) As Al Jazeera journalist Peter Greste was flying to freedom Sunday after 400 days in jail, the man in charge of Egypt was making a long speech lamenting his country's many problems.

President Abdel Fattah al-Sisi touched on the desperate state of the economy, the deadly jihadist insurrection in Sinai, the role of religion in politics and human rights.

Amid this litany of woes, the jailing of Greste, who is Australian, and two other Al Jazeera journalists in Egypt had become an embarrassment for a government whose human rights record was already receiving plenty of adverse attention.

In July, soon after their sentences were handed down to an international outcry, President al-Sisi acknowledged the case had been a PR disaster for Egypt. He told local journalists the trial had been "very negative" for the country's reputation.

"I wished they had been deported immediately after their arrest instead of being put on trial," he said.

JUST WATCHED Al Jazeera journalist released from Egyptian prison Replay More Videos ... MUST WATCH Al Jazeera journalist released from Egyptian prison 10:08

Greste was arrested at the end of 2013 along with Al Jazeera Cairo bureau chief Mohamed Fahmy and producer Baher Mohamed. They were accused of disseminating "false information" and belonging to a "terrorist organization." After a four-month trial, Greste and Fahmy received seven-year sentences; Mohammed got 10 years. As of Monday, Fahmy and Mohamed were still behind bars.

The case against them was part of a heavy-handed campaign against anyone who had anything to do with members or supporters of the Muslim Brotherhood, which was decreed a "terrorist organization" soon after al-Sisi and the military seized power. That campaign was supported by almost hysterical media coverage of the "threat within." Human rights groups say thousands of Brotherhood members are in jail awaiting trial; nearly 200 more have been sentenced to death.

Throughout the proceedings against the Al Jazeera journalists, the Egyptian government -- from al-Sisi downwards -- insisted it had no part in the judicial process.

Few observers took that at face value. Many thought the trio were pawns in a confrontation between al-Sisi and the emirate of Qatar, which funds Al Jazeera. The charges even suggested as much, accusing the trio of broadcasting scenes "through the Qatari Jazeera channel to assist the [Muslim Brotherhood] terrorist group in achieving its purposes of influencing international public opinion."

Australian Foreign Minister Julie Bishop also alluded to the political complexion of the case when the three men were sentenced, saying: "Al Jazeera is not the favorite news channel in Egypt. So my fear is that Peter Greste was in the wrong place at the wrong time."

Throughout the Middle East --- from Syria to Gaza to Libya -- Qatar has funded and supported groups affiliated with the Muslim Brotherhood since the Arab Spring erupted four years ago. Among Qatar's allies was the leader of Egypt's Muslim Brotherhood, Mohammed Morsi, who became President in June 2012 but was ousted by al-Sisi a year later.

Egypt's traditional allies were openly appalled by the sentences against the three. The White House lambasted "the prosecution of journalists for reporting information that does not coincide with the government of Egypt's narrative."

But the journalists' trial (several others were charged in absentia) was part of a pattern. Human Rights Watch said the prosecution "coming after the prosecution of protesters and academics, shows how fast the space for dissent in Egypt is evaporating."

One of many examples: Amr Hamzawy, an academic and former member of parliament, was charged with "insulting the judiciary after a tweet claiming the conviction of 43 employees of pro-democracy organizations demonstrated the "politicization" of the judiciary. He is yet to be tried.

It was a draconian campaign that seemed tone-deaf toward governments that had long enjoyed good relations with Egypt, and which -- in the case of the United States -- provided billions in military aid.

And as harrowing as the experience of the three Al Jazeera journalists has been, others have suffered worse fates, according to human rights groups. After al-Sisi was elected President, Human Rights Watch urged him to investigate "the police and army killings of more than 1,400 demonstrators over the past 12 months and the mounting allegations of torture and other ill-treatment of detainees."

Egypt vs. Qatar

Egyptian officials might argue that the Al Jazeera case was one component of a broader strategy to get Qatar to mend its ways -- and that it worked. In the wake of the military takeover in Egypt, Qatar had become a sanctuary for Egyptian Brotherhood leaders. But in recent months, the Qataris have quietly distanced themselves from prominent Brotherhood figures. Several left Qatar in September, although the Qataris insisted they had not been expelled.

Weeks later, al-Sisi issued a decree allowing Egypt to repatriate foreign prisoners, which is exactly what has happened to Greste. Fahmy holds both Canadian and Egyptian citizenship, so the same procedure seems likely in his case, but Baher Mohamed is Egyptian and his fate remains unclear.

Which brings us back the speech al-Sisi was making Sunday as Greste was being deported. It came two days after the jihadist group Ansar Beit al-Maqdis -- an affiliate of the Islamic State in Iraq and Syria (ISIS) -- carried out its most audacious attack yet on security outposts in the Sinai desert, killing at least 30 people.

Acknowledging the threat from Islamist militancy, al-Sisi spoke of a "dangerous mass that has for the past 30 to 40 years been spreading extremist thought and doesn't want to understand that God had created us different" (code for the Muslim Brotherhood.)

Al-Sisi announced that "east of the [Suez] Canal is now a single military command under the leadership of General Osama Rushdi to fight terrorism." But it's the second time in four months he has promised the Egyptian people that he will combat extremism in Sinai.

He also addressed the shooting death in Cairo last week of political activist Shaima Sabbagh, while casting himself as father of the nation.

"Shaima was the daughter of Egypt and all the daughters and sons of Egypt are my children," al-Sisi said, promising an investigation. Activists claim Sabbagh was shot by police during protests to mark the fourth anniversary of the 2011 uprising, in which more than 20 people were killed. Anti-government protests have become more frequent despite the best efforts of the security forces.

On the parlous state of the Egyptian economy and its public finances, al-Sisi was equally forthright, thanking Saudi Arabia and the United Arab Emirates for their financial support, estimated at $11 billion in the year to July 2014.

"If it was not for your support, Egypt would not have survived until now," he said. But he also admitted the government was still strapped for cash.

"Egypt does not have 150 billion Egyptian pounds (about $20 billion) to spend on its people."