The agency said officers fired smoke and other chemical agents into the crowd after some people began throwing rocks over the fence at border agents.
In addition to rock-throwers, the migrants also began to try to push women and children from among their group forward onto the border boundary, USA officials said, forcing some juveniles to climb over razor wire that the American government has posted in recent weeks as a deterrent to unruly crowds itching to jump the border.
CBP said most of the migrants attempting to cross returned back to Mexico while 25 people, including two teenagers, were detained.
Al Jazeera's Manuel Rapelo, reporting from Tijuana, said central American asylum seekers were preparing to jump the wall.
When people in this group rushed the border in a second incident, U.S. authorities fired tear gas to disperse them. "Border Patrol agents witnessed members of the group attempt to lift toddler sized children up and over the concertina wire and (have) difficulty accomplishing the task in a safe manner", a news release said.
AP, citing its own photographer at the scene, reported that the rocks were launched at the border agents by migrants only after they were pelted with tear gas.
It added that agents could not assist the children "due to the large number of rocks being thrown at them".
Thousands of Central American migrants have been camping at shelters in Tijuana since arriving in November after traveling in caravans across Mexico to reach the US border, where many have hoped to request asylum.
Department of Homeland Security spokesperson Katie Waldman accused "a violent mob of migrants" of "attacking" the border patrol force with "projectiles", saying the agents used "the minimum force necessary" to thwart the attack on the border and defend themselves.
The migrant caravan left Central America in October and travelled 4,300km (2,600 miles) to Tijuana in the hope of reaching the United States and requesting asylum. Many were fleeing gang violence and poverty.
Pres. Trump slammed Democrats in a tweet last week for dragging out the shutdown, saying border agents want the wall as a matter of national security.
The migrants arrested during Monday night's incident will likely face deportation proceedings but will also have the opportunity to apply for asylum.
An impasse with legislators over funding for his border wall project is behind a partial shutdown of United States government services which is now in its second week.