Department of Homeland Security Secretary John Kelly ripped elected officials on Tuesday for regarding the Transportation Security Agency, Customs and Border Patrol, and similar agencies as "political pawns" rather than essential national security personnel, and said Congress has the power to change their mission whenever they want.

"If lawmakers do not like the laws that we enforce — that we are charged to enforce, that we are sworn to enforce — then they should have the courage and the skill to change those laws," Kelly said in a speech at George Washington University. "Otherwise, they should shut up and support the men and women on the front lines."

Kelly seemed intent on reversing DHS's infamously-low employee morale by describing its causes. While immigration hawks blamed the Obama administration for that morale in recent years, and said employees were discouraged by rules requiring lax enforcement of immigration laws, Kelly added another factor: public criticism over the kinds of incidents that go viral on social media.

"For too long, the men and women of my department have been political pawns," he said. "They are often ridiculed and insulted by public officials and frequently convicted in the court of public opinion on unfounded allegations testified to by street lawyers and street spokespersons."

Kelly avoided criticizing the media outlets that run those stories, but he took multiple shots at the lawmakers who he believes piggyback on the furor.

"When you hear a report of a family, — an individual, whatever — at an airport being put into secondary screening, or being refused entry into the United States, believe me, it's not because of their skin color," he said. "There's always, always, always more to the story. I can't tell you the number of phone calls I get from members of Congress telling me about how we're refusing someone's entry at LAX or JFK because they're Muslim, or because they're Arab."

"It's absolutely not true," he said. "We do it for a reason and you should applaud those men and women for doing what they do."