U.S. authorities fired tear gas into Mexico during the first hours of the new year to repel about 150 migrants who tried to breach the border fence in Tijuana.

U.S. Customs and Border Protection said in a statement later Tuesday that the gas was used to target rock throwers apart from the migrants who were trying to cross.

"No agents witnessed any of the migrants at the fence line, including children, experiencing effects of the chemical agents, which were targeted at the rock throwers further away," the statement said.

An Associated Press photographer saw at least three volleys of gas launched onto the Mexican side of the border near Tijuana's beach that affected the migrants, including women and children, as well as journalists. The AP saw rocks thrown only after U.S. agents fired the tear gas.

Reuters reported that a witness did not see any migrants throwing rocks at U.S. agents.

Reuters video shows migrants throwing the tear gas canisters back into the U.S. but does not capture what prompted the U.S. border officials' action in the first place:

U.S. Customs and Border Protection says the tear gas targeted rock throwers, but journalists reported seeing rocks thrown only after the gas was launched. 0:41

The agency said border agents saw "toddler sized children" being passed over concertina wire with difficulty. It said its agents could not assist the children because of the rocks being thrown. Agents responded with smoke, pepper spray and tear gas, it said. The AP journalist also saw plastic pellets fired by U.S. agents.

Twenty-five migrants were detained, according to the agency, while others crawled back into Mexico through a hole under the fence.

U.S. Border Protection officer arrest a migrant that crossed the border fence to get into the U.S. side to San Diego from Tijuana. (Daniel Ochoa de Olza/Associated Press)

Customs and Border Protection said that under its use of force policy the incident would be reviewed by its Office of Professional Responsibility.

Migrants who spoke with AP said they arrived in Tijuana last month with the caravan from Honduras.

The caravan, which left Honduras in mid-October, grew to more than 6,000 members during its month-and-a-half trek north. It has been a constant target of U.S. President Donald Trump, who referred to it frequently in the run-up to U.S. mid-term elections in November.

Migrants run after U.S. Border Patrol agents throw tear gas to the Mexican side of the fence. (Daniel Ochoa de Olza/Associated Press)

Many of the migrants are waiting in Tijuana for a chance to apply for asylum in the U.S., but there was a backlog before the caravan's arrival and the wait is expected to be many months. Others have found jobs in Mexico and tried to settle there.

In a previous incident, U.S. agents launched tear gas across the border after some migrants tried to breach the border following a peaceful march in Tijuana on Nov. 26, 2018. Hundreds of migrants who were downwind of the gas were affected.

Trump is currently locked in a fight with congressional Democrats over funding for the border wall that he wants to build. The stalemate has led to a partial government shutdown.