The Trump administration failed to help a New York Times journalist who was in danger in Egypt and withheld information that he faced arrest, according to the newspaper’s publisher.

In a scathing op-ed, Arthur Gregg Sulzberger accused Donald Trump’s administration of retreating from the US’ “historical role as a defender of the free press” and encouraging other countries to target journalists.

Mr Sulzberger used the alleged incident in 2017 to illustrate his case, claiming that an official in the administration had to act as a whistleblower to reveal that the NYT journalist Declan Walsh was in danger.

The Times received a call warning that Mr Walsh, who is the paper’s Cairo bureau chief, was facing “imminent arrest” in Egypt, Mr Sulzberger said.

The official reportedly acted without the “knowledge or permission” of the Trump administration.

Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam Show all 30 1 /30 Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam Members of the Proud Boys, a fascist group, jeer at anti-Trump protesters outside of the president's 2020 campaign launch in Orlando, Florida Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A supporter dressed as Uncle Sam poses at Uncle Sam Reuters Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A baby blimp rears its head amidst a group of anti-Trump protesters outside the president't campaign launch in Orlando, Florida Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam President Trump addresses supporters at the launch event of his 2020 election campaign in Orlando, Florida Reuters Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam Proud Boys have adopted Fred Perry polo shirts as their uniform and many members have the name of the group tattooed on their arms Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A line of police officers separate opposing groups of protesters outside the launch of President Trump's 2020 campaign launch Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A protester hits a Trump punching bag during a protest outside Trump's 2020 campaign launch in Orlando, Florida Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam Twin Trump supporters pose for a photo at the president's 2020 campaign launch in Orlando, Florida Reuters Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A protester dressed as a caricature of Donald Trump stands outside the president's 2020 campaign launch in Orlando, Florida AP Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A Trump supporter faces off against a protester outside the president's campaign launch in Orlando, Florida AFP/Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A Proud Boy shouts across the police line at anti-Trump protesters outside the president's campaign launch in Orlando, Florida Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A Trump supporter poses for a photo at the president's 2020 campaign launch in Orlando, Florida Reuters Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A Proud Boy jeers at anti-Trump protesters who are separated from the president's supporters by a police line outside the president's campaign launch in Orlando, Florida Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A man dressed as Uncle Sam poses at President Trump's 2020 campaign launch in Orlando, Florida Reuters Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam An anti-Trump protester faces off against a supporter outside the president's campaign launch in Orlando, Florida AFP/Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam Members of the Proud Boys, a fascist group, jeer at anti-Trump protesters outside of the president's 2020 campaign launch Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A child holds a 2020 US "dollar bill" that features Donald Trump's face at the president's 2020 campaign launch EPA Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam Anti-Trump protesters rally outside the president's 2020 campaign launch in Orlando, Florida Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam Anti-Trump protesters rally outside the president's 2020 campaign launch in Orlando, Florida Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam Numerous baby Trump balloons are raised in protests outside of the president's 2020 campaign launch in Orlando, Florida Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A supporter wears a T-shirt depicting Trump as a hero at the president's 2020 campaign launch in Orlando, Florida Reuters Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam President Trump addresses supporters at the launch event of his 2020 election campaign in the Amway Centre in Orlando, Florida AFP/Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam An anti-Trump protester calls for the president to be impeached outside the launch event for his 2020 campaign launch in Orlando, Florida Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam Supporters of Donald Trump face off against protesters outside of the president's 2020 campaign launch in Orlando, Florida AP Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A baby blimp rises behind a group of anti-Trump protesters outside the president's campaign launch in Orlando, Florida AP Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A supporter dressed as Uncle Sam poses at President Trump's 2020 campaign launch in Orlando, Florida AP Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A member of the Proud Boys, a fascist group, holds a sign up outside of the president's 2020 campaign launch in Orlando, Florida AFP/Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A supporter bears a Trump flag at the president's 2020 campaign launch in Orlando, Florida Reuters Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam Protesters hold baby Trump balloons in the rally outside of the president's 2020 campaign launch in Orlando, Florida Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam An anti-Trump protester holds a sign accusing the president of being a traitor Getty

“Rather than trying to stop the Egyptian government or assist the reporter, the official believed, the Trump administration intended to sit on the information and let the arrest be carried out,” Mr Sulzberger said.

“The official feared being punished for even alerting us to the danger.”

The Times was then reportedly forced to turn to Ireland, Mr Walsh’s native country, for help.

Irish diplomats travelled to collect the journalist and safely escort him to the airport, according to the publisher.

Mr Sulzberger added: “We hate to imagine what would have happened had that brave official not risked their career to alert us to the threat.”

In another incident, the publisher claimed that a senior official at the United States Embassy in Cairo failed to support one of the Times’ reporters, David Kirkpatrick, when he was detained and deported “in apparent retaliation” for exposing damaging information on the Egyptian government.

When the newspaper objected to his treatment, Mr Sulzberger said the official replied: “What did you expect would happen to him?

“His reporting made the government look bad.”

Walter Shaub, former director of the Office of Government Ethics, commented that the account showed the Trump administration had “gone from cold war to hot war with the media.”

He added: “This is an authoritarian nightmare."

Mr Trump has consistently attacked the press during his time in office and, as the Times notes, has tweeted about “fake news” nearly 600 times since becoming the president.

In July 2018, Mr Sulzberger met with Mr Trump to discuss his comments about the media.

Although Mr Trump suggested that they agreed on “the vast amounts of Fake News being put out by the media”, Mr Sulzberger said the president had mischaracterised their meeting.

The publisher claimed instead that he criticised Mr Trump’s attacks on the press.