A day after U.S. agents fired tear gas to repel migrants breaking through the border fence in Southern California, Homeland Security officials defended the use of force and their decision to close the country’s busiest port of entry, saying they expect additional confrontations and shutdowns.

Facing dismal conditions in Mexico and long waits for the chance to request asylum in the United States, thousands of Central American migrants are becoming more agitated, and officials see no quick resolution to the tensions that erupted Sunday.

The flow of caravan groups to Tijuana has slowed in recent days, but busloads of other migrants have arrived in Mexicali, 90 miles to the east, where the U.S. border crossing has even less capacity to process asylum seekers. Desperation there could leave U.S. border agents facing volatile crowds in two locations.

On Monday, critics of the Trump administration denounced border agents’ use of force on groups that included families with children, but U.S. officials praised what they called “quick and effective action” against crowds of stone-slinging young men who pried open the border fence at multiple locations to squeeze through.

Kevin McAleenan, the commissioner of U.S. Customs and Border Protection, told reporters that dozens of assaults were committed Sunday against agents, four of whom were struck by projectiles but spared injury thanks to their protective gear.

“U.S. Customs and Border Protection agents and officers in San Diego effectively managed an extremely dangerous situation involving more than 1,000 individuals who sought to enter the U.S. unlawfully and in large groups,” McAleenan told reporters Monday.

“They did so safely and without any reported serious injuries on either side of the border,” he said.

McAleenan said the agency would review the use of force by its personnel, but the deployment of gas and other nonlethal tools to drive back the border jumpers was consistent with the agency’s policies.

Agents in San Ysidro used tear gas during a 2013 incident involving 100 people throwing rocks in an attempted illegal crossing, he said.

Military officials said Monday that about 300 troops will be transferred to California to back up CBP, which has more than 1,000 agents and officers deployed in the San Diego area where Sunday’s melees occurred.

A U.S. Customs and Border Protection officer walks along a wall at the border between Mexico and the United States, as seen from San Diego on Sunday. (Greg Bull/AP)

President Trump suggested earlier this month that U.S. troops could open fire on rock throwers at the border, but in Sunday’s incidents border agents used gas and debilitating “pepper balls” to drive back crowds that broke through.

In at least two locations, migrants breached older barriers, but they did not get past the taller, more modern secondary fencing, topped with concertina wire, that makes the San Diego area one of the toughest places to cross illegally.

Agents arrested 69 border crossers in the no man’s land between the two fences, according to U.S. officials. It was in that area that many of the confrontations with rock throwers occurred, they said.

The migrants who participated in Sunday’s border rush were a minority among the 5,000 or so Central Americans who have arrived in caravan groups to Tijuana in recent weeks hoping to enter the United States. Critics of the administration’s hard-line response have insisted that members of the caravan groups would exercise their legal right to seek asylum at U.S. border crossings. But with more than 4,000 people on a wait list to approach the border crossing, and U.S. immigration authorities insisting that they have the capacity to process just 60 to 100 asylum seekers per day, frustration has been welling at the camp where migrants are sleeping in tents and enduring long lines for food.

U.S. officials said they had been preparing for members of the caravan to attempt a forced entry because the group of mostly Honduran migrants had previously pushed past border police to reach Guatemala and then Mexico.

Mexico sent nine busloads of federal police to encircle the baseball field where the migrants are camped. Thirty-nine migrants were arrested and will be deported, officials said.

Trump told reporters Monday that he was not comfortable with the scenes of children fleeing from tear gas, but he said the tactic was necessary.

“They had to use [it] because they were being rushed by some very tough people,” he said. “. . . Here’s the bottom line: Nobody’s coming into our country unless they come in legally.”

On Monday night, Homeland Security Secretary Kirstjen Nielsen, whom Trump has criticized as weak on border security, issued a lengthy statement heralding U.S. border agents for exhibiting restraint during Sunday’s dustup and admonishing those who attacked them. “It is shocking that I have to explain this,” the statement said, “but officers can be seriously or fatally injured in such attacks. Self-defense isn’t debatable for most law-abiding Americans.”

Nielsen characterized the number of women and children involved in the caravan as “limited.” She accused the caravan’s organizers of using them as “human shields,” saying, “This is putting vulnerable people in harms way.”

U.S. Border Patrol agents have wide latitude to use force if they believe they are at risk of injury or death. Last week, a court in Arizona acquitted an agent who killed a 16-year-old boy by firing through the border fence at a group of rock throwers.

After an overhaul of the agency’s use-of-force policies, the number of incidents involving agents using firearms has dropped, from a high of 55 in 2012 to 17 last year, a result of better training in nonlethal enforcement methods, senior officials say.

The economic impact of Sunday’s border closure — even for just a day — was felt immediately by businesses just north of the San Ysidro crossing that depend heavily on customers from Tijuana, especially on one of the busiest shopping weekends of the year. The San Ysidro Chamber of Commerce estimates that the closure resulted in a loss of $5.3 million in sales for the area’s 650 businesses, as 93 percent of their customers arrive from Mexico.

One retailer at the Las Americas Premium Outlets in San Ysidro that brought in $28,000 in daily sales at this time last year closed out Sunday at $6,000 — losing more than $20,000 in projected sales, according to Chris Wilson, deputy director of the Mexico Institute at the Woodrow Wilson International Center for Scholars.

“This is the busiest time of year for retailers. The whole weekend was dependent on this seasonal opportunity,” said Miguel Aguirre, founder and chief executive of the Border Fusion Group, a cross-border economic- research group.

Aguirre, a developer of commercial shopping centers who owns McDonald’s Trolley Station, steps from the eastern pedestrian border crossing in San Ysidro, said the McDonald’s there was forced to shut down for three hours — the first time he recalled the restaurant ever closing — costing $3,200 in lost sales.

The McDonald’s manager told Aguirre on Monday that many of the employees are too afraid to return to Tijuana for fear they won’t be able to cross back into San Ysidro and will lose their jobs. To be safe, they have chosen to sleep in their cars, Aguirre said.

Of the roughly 70,000 vehicle passengers and 20,000 pedestrians who cross into San Diego each day through San Ysidro, about 30 percent work on the U.S. side — mostly in the hospitality industry, according to Jerry Sanders, chief executive of the San Diego Regional Chamber of Commerce.

Individuals crossing from Tijuana into San Diego spend $10 million to $15 million in Southern California each day at gas stations, restaurants, stores and entertainment outlets, according to Kenn Morris, president of Crossborder Group, a binational market research firm focused on the U.S.-Mexico border.