President Trump defended his travel ban Wednesday morning, and accused the judiciary branch of becoming “political,” just as his executive order continues to face legal challenges in federal court.

The president talked about his embattled executive order during an address to the Washington, D.C.conference of the Major Cities Chiefs Association, which represents the sheriffs and heads of large police forces around the country.

Calling the executive order “beautifully” and “perfectly” written, Mr. Trump said it was meant to address the need for “security in our country.”

Get Breaking News Delivered to Your Inbox

“A bad high school student would understand this,” Mr. Trump said of the ban, which temporarily suspended any entry into the U.S. for all refugees and citizens from seven predominantly Muslim countries.

“It’s as plain as you can have it,” he added. “And I was a good student. I comprehend things very well.”

To prove his point, the president also read parts of his order aloud, focusing on how it allows the chief executive the ability to suspend the “entry of all aliens or of any class of aliens” into the country.

“You can suspend, you can put restrictions, you can do whatever you want,” he summarized. “You’re the chiefs, you’re the sheriffs, you understand this.”

“We have to give you the weapons that you need,” the president told law enforcement officials. “And this is a weapon that you need and they’re trying to take it away from you… we can’t let that happen.”

His order faces several legal challenges. On Tuesday, judges on the San Francisco-based 9th Circuit Court of Appeals heard arguments on whether a temporary restraining order placed on the ban by a lower court should remain in effect. But during the hearing, the panel of three judges also waded into the larger question of whether the ban was in fact unconstitutional.

The president, at the law enforcement gathering, went on to attack the U.S. judicial system as “political.”

“They are interpreting things differently than probably 100 percent of people in this room,” the president said. “I never want to call a court biased, so I won’t call it biased.”

But he added, “courts seem to be so political, and it would be so great for our justice system if they would be able to read a statement and do what’s right.”

Since he signed the travel ban, Mr. Trump has pushed back against members of the judicial branch for their ruling on the executive order.

On Twitter, the president hammered away earlier this week at a Seattle-based judge for issuing a nationwide injunction halting the implementation of the travel ban. He blamed Judge James Robart, a conservative-leaning George W. Bush-era appointee, for allowing terrorists into the country.

The judge opens up our country to potential terrorists and others that do not have our best interests at heart. Bad people are very happy! — Donald J. Trump (@realDonaldTrump) February 5, 2017

Just cannot believe a judge would put our country in such peril. If something happens blame him and court system. People pouring in. Bad! — Donald J. Trump (@realDonaldTrump) February 5, 2017

Later in his speech at the police convention, Mr. Trump also brought up his proposed wall along the U.S.-Mexico border, for which he signed an executive order calling for its immediate construction.

“The wall is getting designed right now,” the president declared. “I wasn’t kidding. I don’t kid.”

He also made a promise to Homeland Security Secretary John Kelly, whose agency is charged with policing and patrolling the border, declaring, “We will give him a wall, and it will be a real wall.”

Mr. Trump also had a message for the local law enforcement chiefs dealing with the undocumented immigrants in their cities and communitied.

“You have the power and knowledge to tell General Kelly - now Secretary Kelly - who the illegal immigrant gang members are. Now you have that power because you know them. You’re there. You’re local. You know the illegals. You know them by their first name. You know them by their nicknames,” he said. “You know the bad ones, you know the good ones. I want you to turn in the bad ones. Call Secretary Kelly’s representatives. And we’ll get them out of our country and bring them back where they came from and do it fast. You have to call up the federal government. Homeland Security.”