President Donald Trump tweeted Monday that Mexican officials should ship the thousands of Central American migrants seeking entry into the U.S. back to their countries of origin by any means necessary, claiming that many are "stone cold criminals."

Trump suggested that Mexico send the migrants back to countries such as Guatemala and Honduras by airplane, bus or "anyway you want." The president also threatened to shut down the U.S. southern border "permanently" if needed.

The tweet came after U.S. Customs and Border Protection officials fired tear gas on hundreds of migrants who sought to enter the U.S. on Sunday near San Diego. That interaction led to U.S. officials shutting down the San Ysidro Port of Entry between San Diego and Tijuana for more than six hours.

In a statement, border patrol said it used tear gas and pepper spray after several migrants struck agents with rocks. No injuries were reported.

"DHS will not tolerate this type of lawlessness and will not hesitate to shut down ports of entry for security and public safety reasons," Department of Homeland Security Secretary Kirstjen Nielsen said Sunday in a statement.

Some migrants, meanwhile, said they sought to cross over illegally after they were denied access at the port of entry, where they could claim asylum. It is not illegal to seek asylum.

The hundreds of migrants who assembled along the Mexican side of the border on Sunday morning were part of a larger group of about 6,000 who crammed into shelters in Tijuana. Many of the migrants are fleeing violence in their home countries.

Images of tear gas being fired at the migrants, some of whom were young children, led to an outcry on social media.

Such incidents at the border have happened before. In 2013 for example, border agents fired tear gas and pepper spray on a group of about 100 people trying to cross the border near the same port of entry after the group hurled rocks and bottles at the officers.

The clash Sunday came one day after the Trump administration and Mexico's incoming government appeared to be at odds over a deal that would keep asylum-seekers in Mexico while awaiting their asylum cases to be processed in the U.S.

The current system allows for asylum-seekers to remain in the U.S. while those cases are processed.