A US federal judge has ordered the Trump administration to temporarily restore White House access to CNN, MS NOW and Politico after the outlets were barred from the premises by President Donald Trump.

In a ruling issued early Thursday, Judge Timothy Kelly said the revocation of the outlets’ press badges was carried out without constitutionally adequate due process.

Kelly said the administration had provided insufficient evidence to support its claim that the ban was based on national security concerns, noting that Trump initially cited the outlets’ alleged “fake news” and negative reporting when announcing the decision.

The judge also said the administration failed to give the outlets notice and an opportunity to appeal before their hard passes were revoked.

Kelly’s temporary restraining order will remain in effect for 14 days, during which both sides are expected to submit further arguments and evidence.

The three outlets had sued the administration, arguing that the ban violated due process and press freedom. The administration maintained that Trump had the authority to determine access to the White House and that the outlets’ reporting had raised national security concerns.

Kelly said the media organisations were likely to suffer irreparable harm without the order, adding that the public interest supported restoring their access.

The ruling comes as Trump prepares to host Chinese President Xi Jinping at the White House.