Congressional critics of the Department of Homeland Security should “shut up’’ and assume the agency is acting appropriately and following the law, the agency’s chief said in a combative public speech Tuesday.

“If lawmakers do not like the laws they’ve passed and we are charged to enforce, then they should have the courage and skill to change the laws,’’ Secretary John F. Kelly said. “Otherwise they should shut up and support the men and women on the front lines.’’

Speaking at George Washington University, Kelly laid out the threats facing the United States — from international criminal networks to homegrown terrorists.

Several times in the speech, he took on critics of the agency, following months of complaints from Congress, civil rights groups and protesters that DHS is targeting Muslim travelers for unfair scrutiny.

Kelly’s first days in office have been dominated by the legal and political fights over President Trump’s executive order barring visitors from about a half dozen majority-Muslim countries, and the administration’s effort to increase deportations of undocumented immigrants. After the first travel-ban executive order was declared unlawful by an appeals court, a second version is on hold, pending a ruling from another appellate court.

[Revised Trump order bans travelers from six Muslim-majority nations]

The problem, Kelly said, is not the practices of the federal agents enforcing immigration laws, but the political games that have been played around such issues.

“For too long, the men and women of my department have been political pawns,’’ he said. “My people have been discouraged from doing their jobs for nearly a decade, disabled by pointless bureaucracy and political meddling, and suffered disrespect and contempt by public officials who have no idea what it means to serve.’’

Kelly, a retired Marine general, said criticism of the agency’s work is often misguided and based on inaccurate reporting.

Lawmakers, politicians and advocacy groups may hear “a partial or inaccurate media report’’ and “assume the men and women of DHS are intentionally abusing innocent individuals while breaking or ignoring U.S. laws or court orders, instead of assuming as they should that the men and women of DHS are carrying out their assigned mission in accordance with the law.’’

“There’s always, always, always more to the story,’’ he said.

Congressional Democrats complained last month that Kelly has been dismissive of their concerns. “This is not boot camp,’’ Rep. Joseph Crowley (D-N.Y.) said after a contentious private meeting with Kelly. “This is not newly inducted members of the Marine Corps. These are experienced lawmakers who understand the law.’’

[Kelly, House Democrats face off at first meeting]

On Tuesday, Kelly framed his remarks as seeking to repair the morale problems that have plagued DHS for years. “The worst morale, I’m told, is in this department,’’ he said, adding that the mood inside DHS already is changing for the better.

Kelly also alluded to a recent decision to ban portable computer devices, such as laptops and tablets, from the passenger cabins of planes coming from 10 airports in the Middle East and Africa. He hinted that such restrictions could grow.

“We have taken some decisions about that that we will likely expand,’’ he said. He did not say how or when such changes might happen. That restriction, which was put in place a month ago, was based on intelligence reports indicating further effort by terrorists to develop homemade explosives that could be hidden in electronics and then manually detonated aboard a plane, according to people familiar with the matter.

[Trump administration moves quickly to build deportation force]

Kelly also indicated that his agency is reviewing how the United States admits visitors from Europe and other members of the Visa Waiver Program. Under that program, visitors from 20 nations do not need a visa, or the screening that goes with a visa, to enter the United States.

“We have to start looking very hard at that program — not eliminating it, but looking very hard at it,’’ he said. Of paramount concern to U.S. security officials has been the thousands of European citizens thought to have traveled to Syria to join terrorist groups. As more of those people return to their home countries in Europe, they could then travel to the United States.

The United States is “the Super Bowl, in terms of terrorists, and that’s what they want to do, and that’s where they want to come,’’ Kelly said.