WASHINGTON — The firing of tear gas canisters by U.S. border agents toward migrants in Mexico near a border crossing last month followed regulations, a senior Trump administration official said in testimony to Congress on Tuesday.

On Nov. 25, U.S. border agents fired tear gas to disperse a group of migrants near the U.S.-Mexico border crossing separating Tijuana from San Diego when some rushed through fencing into the United States.

A day after the incident, Mexico’s foreign ministry presented a diplomatic note to the U.S. government calling for “a full investigation” into what it described as non-lethal weapons directed toward Mexican territory.

Kevin McAleenan, commissioner of U.S. Customs and Border Protection, the agency that oversees the U.S. Border Patrol, said in testimony to the Senate Judiciary Committee that the use of tear gas was within the agency’s regulations and came as agents faced a "difficult situation."

"Pepper spray and CS gas are authorized to address assaultive behavior," McAleenan said, using a common term for tear gas.

The migrants attempting to cross the U.S.-Mexico border “were assaultive in their behavior, they threw rocks at agents,” McAleenan said, adding that one agent had to have surgery as a result of injuries. McAleenan had earlier said in a statement that four agents were hit with rocks but that they did not suffer serious injuries.

Women and small children were within the group of migrants exposed to the tear gas, and images of them fleeing the approaching gas sparked outrage.

Doctors and immigrant advocates decried the use of tear gas, especially in the vicinity of children, arguing they can have more trouble breathing because of weaker respiratory systems. Migrants who were present when the tear gas was fired told reporters they saw children fainting as a result.

McAleenan said women and children were “absolutely not” deliberately targeted by agents firing tear gas canisters.

"The agitators who were throwing rocks were the ones targeted," he said.

CBP is conducting an internal “use of force” review of the incident, McAleenan said.

Groups of Central American migrants have sought this year to cross into the United States in large caravans. The Trump administration has made efforts to block their entry, including by sending thousands of troops to the southern border.

In an exchange at the White House with top Democrats on Tuesday, President Donald Trump vowed a government shutdown if his demand for funding a wall at the U.S.-Mexico border is not fulfilled.