President Trump weighed in on the reinstatement of CNN correspondent Jim Acosta's White House press credential after the White House had revoked it last week, and he also said he has answered questions from the special counsel regarding the investigation into Russia, though he hasn't submitted them.

"People have to behave," he told reporters Friday in response to questions about Acosta, adding, "we're writing up rules and regulations to make our position." He continued, "And if they don't listen to the rules and regulations, we'll end up back in court and we'll win. But more importantly, we'll just leave, and then you won't be very happy."

Mr. Trump insisted that reporters "have to act with respect. You're in the White House." The president reiterated his complaint about the treatment by reporters about White House staff. "And when I see the way some of my people get treated at press conferences, it's terrible," he said. "So we're setting up a certain standard, which is what the court is requesting. And always freedom of the press, always First Amendment."

Get Breaking News Delivered to Your Inbox

At the event, a cyber security bill signing, the president also addressed questions about the Mueller investigation into Russian interference in the presidential election. He told reporters that he had written answers to questions from the special counsel. "I write the answers," he said. "I was asked a series of questions. I answered them very easily." He said he had to be careful because he was sure the questions were "tricked up" to trap him into perjuring himself. Mr. Trump said he has not yet submitted the answers because he "just finished them."

Mr. Trump said that the bill, which creates the Cybersecurity and Infrastructure Security Agency, was "so important."

Mr. Trump spoke to reporters hours after a judge ruled that the White House must reinstate the hard pass for CNN reporter Jim Acosta. The White House had removed Acosta's pass last week after he and the president sparred during a press conference.

Judge Timothy J. Kelly, a Trump-appointed judge, found that since the president did not inform Acosta at the press conference that he would or could have his credential taken, that Acosta's due process rights under the Fifth Amendment had been violated. Therefore, Kelly said, Acosta was never given a meaningful opportunity to rebut the White House's decision.

White House press secretary Sarah Sanders issued a statement in response to the ruling, affirming that the White House would "temporarily reinstate the reporter's hard pass." She added that the White House will also "further develop rules and processes to ensure fair and orderly press conferences in the future. There must be decorum at the White House."

With reporting by Kathryn Watson