President Donald Trump reacted to an order from a federal judge to reinstate CNN reporter Jim Acosta’s press credentials on Friday, demanding decorum from reporters at the White House.

“People have to behave. We’re writing up rules and regulations,” Trump said, referring to how he wants reporters to conduct themselves in the White House. The president commented on the ruling during a press availability for reporters at the White House.

The White House pulled Acosta’s credentials after he refused to give up a microphone to a White House intern during a press conference. CNN and Acosta sued the administration, arguing that there was no due process in the decision and that it was against his First Amendment rights.

U.S. District Court Judge Timothy Kelly ordered the White House to return Acosta’s White House “hard pass” security clearance issued by the Secret Service, ruling that there was, in fact, no “due process.”

The president said his staff would create a process of how reporters should comport themselves in the White House.

“If they don’t listen to the rules and regulations, we’ll end up back in court, and we’ll win,” Trump said.

He also threatened that he or his staff would leave press events entirely if reporters refused to act appropriately.

“You have to act with respect. You’re in the White House, and when I see the way some of my people get treated at press conferences, that’s terrible,” Trump said, adding, “We always have the option of just leaving.”

The president said he supported “total freedom of the press” but added, “we have to practice decorum.”

“You can’t take three questions and four questions,” he said. “You can’t stand up and not sit down.”

Acosta returned to the White House on Friday afternoon after the hearing ended: