OTTAWA -- Border Security Minister Bill Blair says he is talking to lawmakers in the United States about closing a loophole in Canada's border agreement with the U.S. -- one seen as giving asylum-seekers reason to cross into Canada through fields and forests.

The Safe Third Country Agreement says asylum-seekers cannot claim refugee protection in Canada if they arrive at an official border checkpoint from a country that is considered safe, such as the United States.

But they can claim refugee status if they are already in Canada, which is why tens of thousands of asylum-seekers have been crossing into Canada through unofficial entry points on foot.

"There has been some discussion about how we might apply the agreement to those who present themselves at a place other than the border where there's clear evidence that they've come from the United States, that they were in a place that was, in fact, a safe third country, or if they've made application in the United States and they have legal travel documents in the United States," Blair told The Canadian Press Friday.

"There are ways, we believe, that we could apply the agreement more broadly to those people and therefore disincentivize them from crossing irregularly."

Canada first began experiencing an influx of "irregular" border crossers in early 2017, shortly after U.S. President Donald Trump announced he would end a program that offered temporary protected status to migrants from several countries in the United States.

Over 40,000 asylum-seekers have since arrived in Canada from the U.S., avoiding official border checkpoints where they would have been turned back.

The issue has sparked calls for Canada to suspend or amend the agreement.

Blair said the U.S. has also had people crossing irregularly from Canada into America, if not as many as have come the other way. This has created an "opportunity to the mutual benefit of both countries" to modernize the agreement, Blair said.

Other potential changes are also being discussed, but Blair would not elaborate, saying it would not be appropriate to negotiate a bilateral treaty in public.

"There are ongoing discussions," he said. "The agreement worked quite effectively for well over a decade and continues to work at regular points of entry and at our airports, but unfortunately there is this exemption that exists in the current agreement that allows people to avoid its terms if they present themselves at an irregular border point, so that's one of the things we are hoping to address in those discussions."

An internal memo released under access-to-information law shows the Trudeau government has been working since 2017 to update the Safe Third Country Agreement (sometimes called the STCA).

A briefing note prepared for Immigration Minister Ahmed Hussen ahead of meetings he had with U.S. Secretary of Homeland Security Kristjen Nielsen on Jan. 18, 2017 highlights concerns over the influx of irregular migrants, saying the Safe Third Country Agreement "is no longer working as intended."

Conservative immigration critic Michelle Rempel has been calling on the government to close the loophole in the agreement for more than a year to prevent those trying to "jump the queue" in Canada's immigration system.

She blames Prime Minister Justin Trudeau personally for encouraging migrants to cross irregularly with a tweet he issued in early 2017, welcoming refugees to Canada.

"Of course, there are real, human consequences of this. The people entering Canada illegally from the safety and security of the United States jump ahead of others around the world whose lives are in peril as they wait for asylum in Canada," Rempel said. "This is an injustice of what should be a fair, orderly, and compassionate immigration system and it has been Trudeau's plan all along."

NDP immigration critic Jenny Kwan says she wants to see Canada fully suspend the agreement because she does not believe the U.S. is safe for asylum-seekers.

"The entire agreement is predicated upon the notion that Canada and the United States have at least comparable, if not equal, policies and procedures around refugee determination," she said.

She pointed to a ruling by U.S attorney general last year saying domestic and gang violence are no longer grounds for asylum in the U.S. She also pointed to U.S. border agents who separated children from their migrant parents when they were detained at the border in mid-2018. Many of those children have still not been returned to their parents.

"This is inhumane treatment that flies in the face of Canadian and International Law on the rights of the child," Kwan said. "The only change that can be made to the STCA that respects the humanity of asylum-seekers and allows Canada to live up to its domestic and international obligations is to suspend the agreement."