March 31 (UPI) -- A federal judge in Washington, D.C., ruled Tuesday that President Donald Trump's executive order cutting funding to NPR and the PBS was a violation of their First Amendment rights.

U.S. District Judge Randolph Moss said the executive order signed in May violated the companies' constitutional rights to a free press because Trump targeted for what he described as liberal views. He described the cut to funding as "viewpoint discrimination."

"The message is clear: NPR and PBS need not apply for any federal benefit because the president disapproves of their 'left-wing' coverage of the news," Moss said in his ruling.

"It is difficult to conceive of clearer evidence that a government action is targeted at viewpoints that the president does not like and seeks to squelch," he added.

"To be sure, the president is entitled to criticize this or any other reporting, and he can express his own views as he sees fit. He may not, however, use his governmental power to direct federal agencies to exclude plaintiffs from receiving federal grants or other funding in retaliation for saying things that he does not like."