Here is a question: Would I still be in prison in Egypt if Donald Trump had been president two years ago? The answer is important not so much because of what it might have meant personally, but because of what it tells us about the ability of the Trump White House to wield its influence beyond brute military or economic force.

The United States has never quite been able to arrange a perfect marriage of its noble founding principles to its daily practice. Every time an American leader wags a finger at a despot over human rights abuses or undemocratic behaviour, cries of hypocrisy follow. But since the end of World War II, the US has been able to stand on its broad commitment to the classical liberal values of individual freedom, democracy and the rule of law to wield its moral authority. It has pushed corrupt and abusive regimes towards better behaviour and inspired resistance among people living under the heels of dictators, often with greater effect than its military could ever have achieved alone.

“The Berlin Wall didn’t come down because people were responding to American howitzers,” a former senior US State Department official, Joseph Nye, told The New York Times. “It came down under hammers and bulldozers wielded by people whose minds had been affected by the ideas of the West.”

I understand that power at a very personal level.

In December 2013, Egyptian state security officials arrested my two colleagues and me on utterly spurious terrorism charges. We were tried and convicted in a case that most independent observers fully understood was a thinly veiled attempt to scare the daylights out of any journalist tempted to take a professionally balanced approach to covering Egyptian politics.

Global institutions have, however imperfectly, tried to use respect for human rights, rule of law and freedom of speech as their organising principles. Until now, the US has been a kind of moral guarantor in that pact.

It took 400 days to spring me from prison and a lot longer to finally free my two Al Jazeera colleagues. But against the odds, it worked.

We will never know exactly what finally pushed Egypt’s president, Abdel Fattah el-Sisi, to let us go. What we do know is it wouldn’t have happened without the enormous weight of pressure from an outraged public, and, crucially, from the US government.

Throughout the time we were in prison, then US president Barack Obama argued repeatedly that Cairo had to behave like a democracy with respect for press freedom and the rule of law if it wanted to be treated with respect.

Obama had no skin in our game, of course – none of us were Americans – and yet he recognised our case as a way of pushing President Sisi to stop using the courts as a political tool. He did it in public, specifically calling for our release at several news conferences, and he did it in private, ordering both his National Security Council staff and the State Department to make our case the first item of the agenda in every meeting with any Egyptian official. He held to that principle in his own phone calls with President Sisi.

The strategy helped because those demanding our release could stand on their own records of respect for the media’s role in a democracy and the rule of law. In other words, they could stand on their moral authority.

I have always choked at the idea of American exceptionalism. It implies a God-given superiority assumed simply because America is, well, American. But as long as US leaders have accepted that notion – however flawed it may be – they have also assumed a responsibility to uphold the ideals that underpin it. If they respect individual rights at home, support freedom of the press, and obey rule of law, they can legitimately criticise dictators and their regimes who don’t.

Since America’s founding, its leaders have recognised that the country’s real authority – as opposed to its power – rests upon its moral standing. And as the world’s most powerful nation, that is not a trivial thing.

And now? Would the outcome have been the same if we’d been in prison with Donald Trump in the White House? We will never know for sure, but I sincerely doubt it.

And here is why.

While Trump has stated that Saddam Hussein was “a really bad guy”, the president suggested the former Iraqi dictator did some things well because he “killed terrorists”. Likewise, Syrian leader Bashar al-Assad may be a murderous tyrant but, says Trump, “he looks a lot better than some of our so-called friends”. And when Fox News presenter Bill O’Reilly suggested that Russia’s Vladimir Putin has been assassinating his rivals, Trump responded, “There are a lot of killers. We’ve got a lot of killers. What? Do you think our country’s so innocent?”

Suddenly, startlingly, Trump’s remarks have placed the US on the same moral plane as some of the world’s most ruthless tyrants.

His tirades against the press are old news, but they are important. By constantly dismissing the media as “fake news”, “a failing pile of garbage” and “very dishonest”, he is undermining one of the fundamental pillars of democracy, and one of the reasons the US has been one of the most stable, prosperous countries on earth.

He doesn’t have to like the media – no president ever has – but democracy works because an unleashed and often rabid press is able to hold the powerful to account. It might not always be dignified or edifying, but it is still a necessary part of the process.

Would Donald Trump have bothered raising our case with the Egyptians? It seems highly unlikely. He has shown no sign of criticising any regime for its human rights record.

But what if he had mentioned our case to President Sisi? Would the Egyptians have paid the slightest heed? Again, the answer must surely be no. Why would they, when Trump has given away the moral high ground by praising tyrants and has gone to such extraordinary lengths to vilify the media and the work they do.

This is deeply troubling, not just because of the damage Trump has done to America’s standing across the globe, but because of the harm that the loss of authority does to the principles that have underpinned the liberal world order since the end of World War II.

Global institutions have, however imperfectly, tried to use respect for human rights, rule of law and freedom of speech as their organising principles. Until now, the US has been a kind of moral guarantor in that pact.

Cynics will argue that it has hardly saved the world from despots and demagogues, but you don’t have to be a visionary to imagine what the world might have been like if World War II had turned out differently.

Of course, as a real estate developer Donald Trump saw the world as a set of zero-sum transactions, in which he’d work hard to screw the best deal he could out of any negotiation. That two-dimensional approach might work well enough when you are trying to get a better price out of a concrete supplier, but it is hopelessly inadequate in the vastly more complex world of international relations. Without a clear moral framework, the world becomes a snake pit of competing national interests.

It isn’t just liberals in the West who are worried about this.

Guess who said this: “It is increasingly becoming difficult to distinguish Trump’s utterances from those of some African tyrants”?

It wasn’t Amnesty International. It was the editorial writer for The Zambian Observer.

You know the world’s axis has tilted a little when commentators in a small African country see nothing to separate the man in the White House from the routine excesses on their own continent.

Without a hint of irony, the paper published a stinging editorial calling for global solidarity in defence of press freedom in the US.

“What Trump is doing to the American media will soon be replicated across the world by dictatorial, tyrannical, intolerant, corrupt and abusive regimes,” the paper wrote. “These will see open hatred for the media as a normal thing by those in power.”

It went on to reject the idea that Trump’s criticism of the American media is harmless. “This is ammunition for tyrants like Edgar Lungu and others on the continent of Africa. What moral authority or influence will the United States embassies on the continent exercise in defence of press freedom in our countries as they used to do before, given Trump’s conduct?”

And that is the unfortunate truth. It’s not just sad, it’s dangerous.

Peter Greste will discuss press freedom at ACMI in Melbourne on Thursday, following a 6pm screening of the film Clash.