When both a Republican county commission and a Democratic governor go to court to stop a president’s fiddling with immigration policy, it’s clear that there are worthy legal questions to examine in a nonpartisan manner.

President Donald Trump’s administration late last year upended the Safe Release policy, which provided assistance to asylum-seekers. Upon crossing the border, the people seeking asylum were helped along their way, usually to family members living somewhere in the United States, where they would wait until their claims were processed. They did not remain in border cities, overloading the system and straining resources.

Today, those seeking asylum — often parents with children — are dumped in communities along the southern border. That has left cities such as Las Cruces and Deming overwhelmed, with some 9,000 migrants left this year in Las Cruces and 4,700 in Deming.

The question the lawsuit seeks to answer is whether the decade-old policy legally could be reversed by decree or whether the abrupt change violated the Administrative Procedure Act. To get answers, the Board of Supervisors of San Diego County — with four Republicans to one Democrat — filed a federal lawsuit last month against the Trump administration. This week, Democratic Gov. Michelle Lujan Grisham has filed her own suit on behalf of the state of New Mexico and the border communities suffering under the new policy.

The New Mexico lawsuit, which includes both the state and the city of Albuquerque, seeks reimbursement for costs because of the policy change and asks the court for injunctions requiring the federal government to return to issuing humanitarian and other assistance to asylum-seekers. Before, immigration officers helped asylum-seekers confirm travel plans, coordinated assistance from various groups, helped them communicate with family or friends, and sometimes even drove people to the bus station or airport.

By going to court, both San Diego County and New Mexico can — we trust — recoup money spent on what is a federal responsibility and, if the law is on their side, push the federal government into handling asylum-seekers with compassion once more. This is a lawsuit that needs to be heard quickly; we hope to see a hearing for a temporary injunction soon so that border communities can receive relief.

That, of course, will not address the larger problem, which is that the United States has a broken immigration system — and most of its challenges will not be improved by building a wall, despite Trump’s anti-immigrant rhetoric. Congress and the president must do a number of things to fix the situation, with perhaps the most important directing aid and assistance to Central American countries so that migrants want to stay home.

Improving Central America was a little-noticed part of the agreement between the U.S. and Mexico, the so-called deal that Trump says was adequate enough to stop him from imposing tariffs on Mexican goods. Announced last week, Mexico supposedly will do more to help intercept migrants in return for no tariffs. The deal also calls for “a more prosperous and secure Central America to address the underlying causes of migration” on the part of both countries. That’s the statement we want to see addressed.

At home, the United States needs to put more resources into the court system so that asylum claims can be processed swiftly. That would be a better use of money than a wall that can’t keep out asylum-seekers; the right of people to seek safety, after all, is enshrined in both international and U.S. law.

More broadly, the nation must pass laws that let immigrants travel here in a transparent and orderly fashion, provide legal status for young adults brought here without papers as children and stop the practice of detaining people in an inhumane fashion. Once people stop seeking asylum because they are safe at home, the world will be better off.

By filing suit, New Mexico and San Diego County could push the Trump administration and Congress into finally tackling immigration. That’s a result both parties should support.