Officials arrested 42 migrants on the US side of the border with Mexico on Sunday, a border patrol official said, claiming agents released teargas only when attacked with rocks.

The US official also answered criticism of the use of gas on groups including women and children, images of which spread rapidly online on Sunday, by saying the migrants pushed “women and children towards the front”.

The arrests came amid clashes with members of a migrant caravan attempting to enter the US from Tijuana, where teargas was used to repel people trying to run across the border.

Rodney Scott, the chief agent for the San Diego sector, told CNN on Monday morning his agents arrested 42 people who made it across the border. Thirty-nine arrests were reported on the Mexican side of the border.

Scott said eight of those arrested were women, and there were “only a few” children involved. “The vast majority of the people we’re dealing with are adult males,” he said.

The official rejected criticism of the use of teargas on a group that included children, saying some migrants had pelted agents with rocks and debris.

“The group immediately started throwing rocks and debris at our agents, taunting our agents,” he said. “Once our agents were assaulted, the numbers started growing. We had two or three agents at a time initially facing hundreds of people at a time. They deployed teargas to protect themselves and to protect the border.”

Three agents were struck by rocks but were wearing helmets, shields and vests and were not seriously injured, Scott said. He said a number of border patrol vehicles were damaged.

Members of the migrant caravan are mostly Central Americans fleeing violence or poverty in their home countries and planning to apply for asylum in the US.

Democrats and other critics called the Trump administration’s use of teargas toward the migrants an overreaction, and blamed the administration for rejecting efforts to address larger immigration issues.

“Teargassing families seems unnecessary,” Lee Gelernt, the deputy director of the ACLU Immigrants’ Rights Project, told CNN.

Scott said “numerous people” made it across the border in an area where a wall is in the process of being built. Parts of the border have a dilapidated wall made of scrap metal, Scott said.

“The group breached a couple sections of that, actually tore down one small section, started to rush across,” he said. “And that’s another time that they started assaulting our agents. We were able to hold them back using riot techniques.”

Scott said members of the group passed border patrol units “chanting, waving the Honduran flag, and throwing rocks” and did not surrender to apply for asylum. “If they were true asylum seekers, they would have just walked up with their hands up and surrendered,” he said. “And that did not take place.”

Scott claimed the caravan had pushed women and children to the front of the group, resulting in images of small children fleeing from teargas that sparked outrage – a claim that was rejected by migrants in the group.

“The group … would push women and children towards the front, and then begin basically rocking our agents,” he said. “We try to target specifically the instigators, specifically the person assaulting the agents, but as you saw from the video, once that chemical is released it does go through the air.

Lurbin Sarmiento, 26, of Copán, Honduras, said she had been with her four-year-old daughter at a concrete riverbed when US agents fired the gas.

“We ran, but the smoke always reached us and my daughter was choking,” Sarmiento told the AP, adding that she would never have approached the border fence if she thought there would be teargas.

The crossing at Tijuana was closed on Sunday but open again on Monday.

Early on Monday, Donald Trump tweeted: “Mexico should move the flag waving Migrants, many of whom are stone cold criminals, back to their countries. Do it by plane, do it by bus, do it anyway you want, but they are NOT coming into the U.S.A. We will close the Border permanently if need be. Congress, fund the WALL!”