The Trump administration must restore the press credentials of a CNN political reporter who has been denied access to the White House, a Washington federal trial judge ruled Friday, handing a blow to a president who has continually bashed some media organizations as “fake news” and called reporters “enemies of the people.”

U.S. District Judge Timothy Kelly, appointed by Trump last year to the federal trial bench, handed down the decision Friday after hearing arguments for two hours earlier this week. Kelly had initially planned to issue his decision at a Thursday afternoon hearing but postponed his announcement until Friday.