A United States (US) federal judge has ordered the Trump administration to restore White House access for journalists from CNN, MS NOW and Politico, finding that the ban imposed on the outlets was likely unconstitutional.

US District Judge Tim Kelly directed officials to return the three outlets’ press passes and barred the administration from enforcing the ban for 14 days while the legal challenge continues.

The outlets had filed a lawsuit after President of the US Donald Trump announced on September 18 that they would be barred from the White House. They argued that the decision violated First Amendment protections for freedom of speech and the press, as well as their right to due process.

Kelly rejected the administration’s argument that the restrictions were necessary on national security grounds, saying there was insufficient factual support to show that removing the outlets’ access would protect national security.

Trump had defended the ban on social media, accusing the three outlets of repeatedly reporting “FICTION and LIES.” Justice Department lawyers later argued that White House access was a privilege rather than a right and that the president had authority to restrict access.

The judge also raised concerns about whether the White House had given the outlets a meaningful opportunity to challenge the decision before their press passes were revoked.

During a hearing on Wednesday, Kelly cited two rulings from the US Court of Appeals for the District of Columbia Circuit that he said established due process protections for journalists before their White House access can be withdrawn.

The Justice Department argued that the administration had provided an adequate explanation in letters sent to the news organisations after the access was revoked. Kelly questioned the timing of those letters, which were issued after the ban and after the outlets had filed their lawsuit.

The case has drawn support from press freedom groups and other news organisations. A coalition argued in a court filing that removing journalists from White House access based on their editorial views conflicts with established First Amendment protections.