(Bloomberg) -- Chile’s government is deploying troops to its border with Peru and Bolivia to try and stem a rise in illegal immigration amid a mounting backlash against new arrivals.

A bill passed by congress last month came into effect Monday, authorizing the military to take over further security tasks at the borders. Local TV showed troops patrolling one side of a ditch dug along the border high up in the Andes mountains, with would-be immigrants stranded on the other side.

The move is the latest by Chile’s most left-wing government in 50 years to try and revert a slump in its popularity after a year in office. It has also sent troops to the south to deal with attacks by local indigenous group, backtracking on earlier pledges, and turned up its rhetoric on the fight against crime. 

“Chile hasn’t done what it should have done to take control of its borders for a long time now,” Interior Minister Carolina Toha told reporters in Colchane, a commune in the north which adjoins Bolivia. “We were not only lacking the military, but many other things: personnel, technology, facilities, legal faculties, budget.” 

Toha also said that Chile is in talks with Bolivia and Peru on how to better secure its borders.

With a population of about 19 million, Chile was home to almost 1.5 million foreigners in December 2021, according to the National Migration Service. That figure has doubled since 2017. Close to one third of foreigners are Venezuelans, while 17% come from Peru, 12% from Haiti and 12% from Colombia. Bolivia comes next with almost 9%.

©2023 Bloomberg L.P.