Central American migrants on inside an enclosure on Wednesday in El Paso, where they are being held by U.S. Customs and Border Protection. (Jose Luis Gonzalez/Reuters)

THERE IS a genuine problem at the U.S.-Mexico border, as President Trump says. Unfortunately, his proposed solutions will not help. Worse, his defiance of Congress puts a genuine solution further out of reach. But — and here’s the good news — there is action Congress could take that would help, and an imaginable political route that would bring victories all around, including to the United States’ young “dreamers.”

The problem is an upsurge in Central American families arriving at the border, in numbers that constitute “an unprecedented humanitarian and border security crisis,” according to Kevin K. McAleenan, the commissioner of U.S. Customs and Border Protection. Speaking to reporters in El Paso last Wednesday, Mr. McAleenan said agents had detained more than 4,100 migrants on the previous day, the highest for one day in more than a decade. Many are adults traveling with children; some are unaccompanied minors. The numbers, the commissioner said, are overwhelming the United States’ ability to process people safely and humanely. Many will end up being “paroled” into the United States, though they are not legally entitled to settle here.

This is bad for everyone. No matter what level of immigration you favor — and we support healthy levels of legal immigration — every country wants to control its borders and decide who may enter. Meanwhile, thousands of desperate Central American children are being lured into a potentially hazardous journey.

Cutting off aid to Central America or “closing the border,” as Mr. Trump now threatens, would make things worse. Already he has declared a legally dubious emergency to spend funds that Congress refused to appropriate for border fencing the body had determined to be unnecessary. And this crisis proves Congress correct. Some of these undocumented arrivals are indeed skirting the fence — but as soon as they do, they turn themselves in. They want to be apprehended.

That is because current law prevents the government from detaining children, either alone or with relatives, for long. If the migrants claim asylum, they must be released before their claim can be considered. They enter the United States, perhaps find work, perhaps go underground before their hearings ever take place. This creates a powerful incentive for Central Americans who are struggling to make a living at home.

Mr. McAleenan would like Congress to give him authority to hold these migrants for up to eight weeks. That would allow time to process their claims, which would in many cases be denied. He also wants authority to return unaccompanied children to their home countries, which the law allows for Mexicans and Canadians but not Central Americans. If word got out that paying $7,000 to “coyotes” for the trip to the border was likely to result in a prompt return trip, the flow would diminish — which would mean fewer children in danger.

Congress should consider both requests favorably, along with more aid to Central America to get at the root causes of this exodus. But given the contempt Mr. Trump has shown toward congressional authority, toward migrants and toward the truth, the ground for compromise is less than fertile. One natural road would be to couple the changes needed to address the true border emergency with a path to legal status for up to 2 million dreamers and immigrants with previously protected status — longtime, law-abiding residents of the United States who would greatly boost the economy if allowed to live and work without fear. Sens. Lindsay O. Graham (R-S.C.) and Richard J. Durbin (D-Ill.) have reintroduced a Dream Act, showing that bipartisan cooperation is not entirely beyond reach. Their colleagues should take this path forward.