FILE PHOTO: A group of asylum seekers pass a Canadian army vehicle as they walk down the street while escorted from their tent encampment to be processed at Canada Border Services in Lacolle, Quebec, Canada August 11, 2017. REUTERS/Christinne Muschi/File Photo

OTTAWA (Reuters) - Canada said on Tuesday it planned to spend an additional C$1.2 billion ($902 million) over five years to stem the flow of irregular migrants from the United States, which has become a political threat to the Liberal government ahead of an October election.

Some 57,000 asylum seekers from Nigeria, El Salvador, Honduras and other nations crossed the U.S. border into Canada last year, in some cases citing a fear of persecution by the government of U.S. Donald Trump.

They are allowed to stay until their cases have been heard. Given Canada’s clogged judicial system, that could take years.

Canada began prioritizing the deportation of asylum seekers who walked across the border last year, in a bid to tackle the politically sensitive issue.

In the annual budget, Finance Minister Bill Morneau said Ottawa would implement a comprehensive border enforcement strategy “to detect and intercept individuals who cross Canadian borders irregularly and who try to exploit Canada’s immigration system.”

Most arrive in the populous provinces of Ontario and Quebec, which have spent hundreds of millions of dollars taking care of the newcomers. Critics complain that Ottawa is not doing enough to deter the migrants and Liberals concede the issue is hitting the party’s popularity.

According to the budget, the government will start spending the C$1.2 billion in the 2019-20 fiscal year to strengthen the border and speed up the asylum process. Ottawa will also try to “better manage, discourage and prevent irregular migration,” the budget text said.

Canadian officials have over the past two years visited Nigeria, as well as various ethnic communities in the United States, to try to persuade would-be migrants to stay put.

The officials have said that although the people driving the migrant surge claim that everyone who crosses the border is allowed to stay, most are sent back once their cases have been handled.