President Donald Trump today attacked those challenging his travel ban, saying even a "bad high school student" would understand the law that confers on the president the power to restrict immigration.

Trump spoke to members of the Major County Sheriffs' Association and the Major Cities Chiefs Association at their winter conference in Washington, D.C. As Trump defended his immigration executive order, he insisted the country is "at risk" because of the temporary halt on the order, and he called the ban a "weapon" necessary for the security of the nation.

"We have to give you the weapons that you need, and this is a weapon that you need, and they're trying to take it away from you," he said.

Trump hinted to the audience about what he has learned about terrorism from his briefings, claiming it is a "far greater threat" than Americans realize.

"Believe me, I've learned a lot in the last two weeks, and terrorism is a far greater threat than the people of our country understand," he said. "But we're going to take care of it. We're going to win. We're going to take care of it, folks."

He did not elaborate on any specific threats.

Trump, who told the crowd that he listened to Tuesday night's federal court arguments between the Department of Justice and Washington state over the order, read from U.S. code detailing the president's power to restrict immigration when it is "detrimental" to the interest of the country.

"You could be a lawyer, or you don't have to be a lawyer. If you were a good student in high school or a bad student in high school, you could understand this," he said.

"I don't ever want to call a court biased, so I won't call a court biased ... We haven't had a decision," he said. "But courts seem to be so political. It would be so great for our justice system if they would be able to read the statement and do what's right, and that has to do with the security of our country, which is so important."

Trump said that he thought there should have been a one-month or one-week warning before the order but that he was advised not to issue such a warning.

"We do things well. We did things right, but the law enforcement people said to me, 'Oh, you can't give a notice because if you give a notice that you're going to be really tough in one month from now or in one week from now,'" he said. "I suggested a month, then I said, 'Well, what about a week?' They said, 'No, you can't do that because then people are going to pour in.'"