Former acting Immigration and Customs Enforcement Director Thomas Homan delivered a fiery defense of border agents during a House hearing where Democratic lawmakers just hours earlier had decried conditions at migrant detention centers -- as he ripped into the agency's congressional critics and said they should be “ashamed” of their conduct.

"If you don't like this, do your job. Fix it," Homan testified before the House Oversight Committee, recalling in graphic detail his own experiences on the job seeing dead bodies in tractor-trailers as he underscored the severity of the border crisis.

He said agents, amid this crisis, have been subject to “unprecedented attack and vilification” and “those men and women who chose a life of service to this nation deserve better, not only from the media but those in this committee and other members of Congress.”

AOC TEARS INTO TRUMP FOR 'MANUFACTURED' BORDER CRISIS AT EMOTIONAL HEARING ON MIGRANT DETENTION

“As a 34-year veteran of law enforcement, it is shocking, shocking to see constant attacks against those that leave the safety and security of their homes every day, put on a Kevlar vest and put a gun on their hip and risk their own safety to defend this nation,” he said, at times appearing to get choked up as he defended his former colleagues.

He appeared to be in part referring to accusations by Rep. Alexandria Ocasio-Cortez, D-N.Y., and others who have made a host of allegations against agents, including that migrants were made to drink from toilet bowls. Ocasio-Cortez blasted the Trump administration's immigration policies and stood by her accounts from the border during testimony earlier Friday, alongside colleagues Rep. Rashida Tlaib, D-Mich., and Rep. Ayanna Pressley, D-Mass.

“Those that attack the professional integrity of those that serve and blatantly throw unsubstantiated allegations against these men and women with zero evidence of guilt are wrong and should be ashamed,” Homan shot back.

Much of the focus of the hearing was on the treatment of migrants detained crossing the border by the tens of thousands each month. But while acknowledging there was a humanitarian crisis at the border, Homan pushed back on some of the rhetoric being used by Democrats and activists who have accused agents of misconduct and mistreatment of migrants.

“The same people that vilify border patrol for detention conditions are the same people that refuse to answer the call for help, until it’s too late,” he said, apparently referring to those Democrats who refused to back a bill that increased humanitarian funding by $4.5 billion to the border.

HOUSE DEMS USE OBAMA-ERA PHOTOS TO PROMOTE 'KIDS IN CAGES' HEARING

He pointed to the more than 4,000 lives saved by Border Patrol agents last year, and said that it was “disheartening” that no one had mentioned that at the lengthy hearing.

“No one talks about how these men and women bring toys from their homes and their own children to these facilities so the migrant children will have something to play with,” he said. “No one talks about the sickness of these migrants and how these agents take that sickness home to their own families because of that exposure.”

He asked if any of the critics have attended a burial of a law enforcement agent killed on duty, or consoled a child or spouse of a fallen officer.

“I have...too many times,” he said.

Homan upset Democrats on the panel. Rep. Gerry Connolly, D-Va., denounced what he described as “equivocation” and screamed at Homan when he tried to object.

CLICK HERE TO GET THE FOX NEWS APP

“You're not at the border, this is a hearing room, this is my time,” he yelled.

Homan later blasted what he called "political grandstanding" and urged members of Congress to change the law if they don't like the current law.

"Don't blame the men and women wearing the uniform doing the best they can, it's outrageous," he said. "This is political theater at its best."