Australian Al Jazeera journalist Peter Greste, who spent 400 days in a prison in Cairo, has said governments should stop using the war on terrorism to curb freedom of speech.

Greste made the comments as he addressed journalists at the National Press Club in Australia. He said freedom of speech is being threatened and journalists should be protected.

"It almost feels like a kind of globalised McCarthyism, where simply invoking terrorism is enough in some cases to get away literally with murder," he said.

"In this new world, to simply ask questions about the conflict or to seriously investigate either extremism or the government's handling of it is to make yourself a target," he continued. "The trouble for us journalists is that in this conflict there is no neutral turf, no safe ground from which to report.

"In effect, what it has done is to make the media the battleground."

Greste and two other colleagues, Canadian Mohamed Fahmy and Egyptian Baher Mohamed, were detained on the grounds that they allegedly supported the Muslim Brotherhood, an organisation banned by the Egyptian government after its leader Mohammed Morsi and the then president of Egypt was overthrown in 2013.

Greste and Fahmy were sentenced in June 2014 to seven years in prison, while Mohamed was sentenced to 10 years.

During their detention, Greste and Mohamed elaborated a plan to protect other journalists facing politically motivated charges.

Greste explained he would like to create a universal media freedom charter to operate in the same way as the UN declaration on human rights.

"We wanted to find a way to help protect journalists that might transcend state boundaries and in the end he suggested some kind of universal media freedom charter," Greste said.

"It would set a gold standard defining the relationship between governments and the media. It would set out the responsibilities of each. It could be used as a kind of benchmark by which both of us can be measured.

"We're not meant to be friends of the government, friends of politicians," he continued. "We're meant to hold them to account.

"That's our job. It's why we exist, it's what the whole point of the fourth estate [...] and we shouldn't be apologetic about that."

Greste's comments came as two Al Jazeera reporters were detained by the Nigerian military for "loitering" in areas where military operations are ongoing against Boko Haram terrorists.