They are part of caravans of migrants that started trekking from Honduras weeks ago.
"If they're launching tear gas, it's better to head somewhere else", he said.
"They had to use (it) because they were being rushed by some very tough people and they used tear gas and here's the bottom line: nobody's coming into our country unless they come in legally", Trump told reporters.
About 5,000 Central American migrants have been staying at a sports center in Tijuana for more than a week.
Alyssa Milano also slammed the President tweeting at him: "You tear-gassed women and children, a-wipe!"
The refugees are legally allowed to apply for asylum in the United States, but this process has been known to take as long as a year.
Officials reopened the crossing at the San Ysidro port of entry between San Diego and Tijuana on Sunday after shutting it down for several hours. He is anticipating that thousands of more migrants will arrive soon.
"Mexico should move the flag waving Migrants, many of whom are stone cold criminals, back to their countries", Trump wrote on Twitter.
Image A migrant family runs from tear gas released by US border patrol
Homeland Security Secretary Kirstjen Nielsen said in a statement that some migrants "attempted to breach legacy fence infrastructure along the border and sought to harm CBP personnel by throwing projectiles at them. Congress, fund the WALL!" We are affected at the border crossing.
The migrants, mostly Hondurans, have travelled to the border in large groups, or caravans and now number more than 8,000.
Although Mexican police were stationed nearby, they were outnumbered and overwhelmed by the unexpected rush. Pictured in a now-viral image is a mother sprinting away from the tear gas bombs, with two young, barefooted children in hand. The military's role is limited largely to erecting barriers along the border and providing transportation and logistical support to Customs and Border Protection. "We must never get used to the horror that is this President".
On Monday morning, President Donald Trump called on Mexico to deport asylum seekers "back to their countries" and threatened to close the southern border "permanently" if the situation at the border was not brought under control. In another photo, one of the little girls, who is wearing only a T-shirt and diaper, weeps after running from the gas.
Numerous thousands who have gathered in Tijuana have said they will wait there until they can seek asylum.
Democratic lawmakers and immigrant rights groups blasted the border agents' Sunday tactics.
A third man, who wished to remain unnamed, showed AFP what he described as injuries from rubber bullets.
Trump has deployed almost 6,000 troops, on top of more than 2,000 National Guardsmen, but Scott said the Department of Defense was not involved in Sunday's engagement.
Numerous thousands who have gathered in Tijuana have said they will wait until they can seek asylum.
Mexico border crossing closed after migrant protest halted in Tijuana
Videos posted on Twitter showed large numbers of migrants dashing across a shallow concrete waterway towards the border. It said that 1,906 of those who have returned were members of the recent caravans.