FILE PHOTO: U.S. Military troops deploy with U.S. Customs and Border Protection agents while conducting a large-scale operational readiness exercise at the San Ysidro port of entry with Mexico in San Diego, California, U.S., January 10, 2019. REUTERS/Mike Blake/File Photo

WASHINGTON (Reuters) - The U.S. military will extend a mission to support security along the U.S. border with Mexico through Sept. 30, the Pentagon said on Monday.

Acting Defense Secretary Patrick Shanahan approved the extension in response to a request from the Homeland Security Department, the Pentagon said in a statement. There are about 2,350 troops assigned to the border mission.

The deployment had previously been authorized through Jan. 31 by former Defense Secretary Jim Mattis.

President Donald Trump ordered the deployment in October, shortly before November congressional elections, as a part of an effort to crack down on illegal immigration, as waves of thousands of migrants escaping violence in Central America trekked toward the United States.

Critics, including opposition Democrats in Congress but also some U.S. military veterans, have derided the troop deployment as a political stunt.

The Pentagon said it was “transitioning its support at the southwestern border from hardening ports of entry to mobile surveillance and detection, as well as concertina wire emplacement between ports of entry.”

It said it would continue to provide aviation support.