(Reuters) – The Canadian government on Friday denied that the rights of any refugees are threatened by a U.S.-Canada agreement that compels asylum seekers trying to cross the border into Canada to first apply for sanctuary in the United States. Under the Safe Third Country Agreement between the two neighbours, asylum seekers at a formal border crossing travelling in either direction are turned back and told to apply for asylum in the country they first arrived in. Lawyers for unnamed refugees who had been turned away at the Canadian border are challenging the agreement, saying the United States does not qualify as a “safe” country under U.S. President Donald Trump. Asylum seekers Canada turned back faced indefinite detention and solitary confinement in the United States with often little access to legal counsel, refugee lawyer Andrew Brouwer said on Monday. The Canadian government argued in its submission that its “continued reliance on the regime is lawful and meets its Charter and international law obligations,” however. “There’s no rights at stake here,” government lawyer Lucian Gregory told the federal court. The court challenge comes as Canada seeks to stem the human tide of asylum seekers that has flowed into the country over the past three years. Trump was elected in 2016 after promising in his campaign to crack down on illegal immigration. Prime Minister Justin Trudeau’s Liberal government has changed eligibility rules and wants to expand the Safe Third Country agreement so that it applies to the entire border, not just official border crossings. Refugee lawyer Leigh Salsberg argued the U.S. system was especially unsafe for women because many U.S. immigration judges don’t regard gender-based violence as grounds for a refugee claim as they do in Canada, meaning that someone who might qualify for refugee status in Canada might be deported from the United States back to their country of origin. Canada countered that many women have obtained refugee status in the United States and there are enough checks and balances to eliminate any dangers. Week-long arguments wrapped up on Friday, with the judge expected to render her decision on whether to maintain or suspend the agreement at an undetermined point in the future. Immigration and Refugee specialist Robert Falconer said suspending the agreement “would have huge implications” for the Canada-U.S. relationship. “(The Trump administration) might take that to be more of an insult. But the administration might not be turned off by that because it means more people leaving the United States to come to Canada,” he said. More than 50,000 people have illegally crossed the Canada-U.S. border to file refugee claims over the past three years, walking over ditches and on empty roads along the world’s longest undefended border. Some asylum seekers have told Reuters they might have stayed in the United States had it not been for Trump’s immigration rhetoric and policies.