​US immigration officials defended the timing of raids on food processing plants in Mississippi that came just days after a gunman targeted “Mexicans” during a mass shooting at an El Paso Walmart.

“Something like this has been planned for over a year,” acting Homeland Security Secretary Kevin McAleenan told NBC’s “Meet the Press” in an interview Sunday. “This is a criminal investigation with 14 federal warrants issued by a judge, and ICE had to follow through on that. It was already planned and in motion.”

NBC’s Chuck Todd pressed him on whether in hindsight the operation that detained 680 illegal workers should have been postponed.

“The timing was unfortunate,” McAleenan admitted.

Mark Morgan, the acting commissioner of Customs and Border Protection, called them “targeted law enforcement operations.”

It “was a joint criminal investigation with ICE and the Department of Justice targeting work-site enforcement, meaning companies that knowingly and willfully hire illegal aliens, so that, in most cases, they can pay them reduced wages, exploit them further for their bottom line,” he said on CNN’s “State of the Union.”

Morgan was asked why the focus was on the workers and not the employers.

“It’s a pending criminal investigation right now. There’s a criminal search warrant to go in there to collect more information, more intelligence, and that investigation is ongoing. But that’s the intent of that investigation,” he said.

He was also shown the video of an 11-year-old girl who was sobbing as she asked immigration officials to release her father​ who had been nabbed in the raids.​

“I understand that the girl is upset and I get that. But her father committed a crime,” ​he said, adding that the girl was later reunited with her mother.

​McAleenan said US officials were aware of the fears of Hispanics after 22 people were killed in the border town of El Paso the previous weekend – and just days before the raids.

​

​He said Homeland Security considers the shootings an attack “on our community” and is working on the threat of “domestic terrorism.”

The day after the El Paso shootings, a gunman opened fire in Dayton, Ohio, killing nine people and wounding scores more.

​