A House Democrat on Wednesday warned Homeland Security Secretary John Kelly that he should stop telling lawmakers to "shut up," and said if he continues, it will make for a very difficult tenure at the top of the agency.

"My only advice is, understand the system that we're in," Rep. Henry Cuellar, D-Texas, told Kelly in a House Appropriations subcommittee hearing.

"The Executive Branch, and sometimes some of us might disagree with you," he said. "I don't think it's correct for you to tell members of Congress to shut up."

In April, Kelly reacted to mostly Democratic complaints about what they said was the overly aggressive enforcement of U.S. immigration laws. Kelly reiterated the Trump administration's line that DHS will now enforce the laws that the Obama administration had ignored for years.

"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," 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 addressed Cuellar's complaint at the hearing, but didn't apologize for it. He said when he was in the military, lawmakers were always careful to criticize military policy, but not the men and women in uniform who are carrying it out.

But he said lawmakers have been much more critical of DHS employees.

"In this job, all I heard, day in and day out — Nazis, storm troop tactics, prejudice about the men and women, the foot soldiers if you will, that stand on our border or inside our country and protect it," Kelly said.

"And I would just ask: criticize me, criticize the Trump policies, but please recognize that my men and women are doing the same kind of thing day in and day out as our military men and women are, and in a sense, give them a break," Kelly added. "And that's what the shut up comment was about."