Deferred Action for Childhood Arrivals — the Obama-era program for youngsters brought here without documentation by their parents — is dying. All the immigrant advocacy groups say it. Donald Trump, they say, made a wrong and cruel decision on Sept. 5, putting 800,000 young, taxpaying residents at risk of deportation. This decision must be condemned and resisted.

Maybe so. But maybe there is a way to treat the Trump decision as a win-win for all, including the DACA kids. Intended or not, we may be at a “perfect storm” moment to rescue these 800,000 residents.

• First, congressional Republicans are looking for a legislative win, having failed to kill the Affordable Care Act, and they face an uphill climb over the next three months on budget and spending bills, tax reform and the debt ceiling, all coming to a crunch in December. Both Sen. Susan Collins and the elusive Rep. Bruce Poliquin have decried the move, announced by Attorney General Jeff Sessions, and called for relief (as have independent Sen. Angus King and Democratic Rep. Chellie Pingree).

• Second, Senate Majority Leader Mitch McConnell and House Speaker Paul Ryan desperately need to recover their political mojo, having failed on health care and been rolled by the Democrats and Trump on money and debt. Legislating DACA gives them a chance to actually accomplish something, or at least appear effective.

• Third, the White House needs a political recovery program of its own. The Trump administration is rapidly earning a reputation for chaos, death by Twitter and legislative failure, a record unmatched by any White House in our nation’s history.

They may have not meant it, but the administration actually provided the opening for a DACA win-win. Trump and Sessions framed the DACA issue as a constitutional problem, not (for the most part) as an attack on immigrants. Barack Obama, they said, should have asked Congress to create DACA, rather than creating it as an administrative action by the Department of Homeland Security.

Set aside the reality that Congress has been unwilling to legislate anything on immigration for years, which gave Obama the incentive to carry out this end run. Now may be the moment to fix that constitutional issue and save the “dreamers.”

• Fourth, like a gift from the gods, there is actually a bill that would rescue DACA, called the DREAM Act, which was reintroduced in July with impressive bipartisan supporters — a wonder in these days — Sens. Lindsey Graham, R-S.C., Dick Durbin, D-Ill., Chuck Schumer, D-N.Y., and Jeff Flake, R-Ariz.

For every DACA participant and person with temporary protected status, the measure would provide a careful path to citizenship. As long as the person entered the U.S. before the age of 18, has been here for four years before the DREAM Act passed, stayed here until they apply, goes to college or enrolls in a secondary school, are not convicted of criminal offenses and pass a medical exam and a background check, they can eventually become citizens. It would take something like eight years to finish the process, while giving the applicant provisional immigration status.

However they feel about immigrants in general, a majority of Americans feel positive about the DACA kids. They were brought here by their parents as young people and know no other country. Since 2012, they have grown up, hold jobs, go to school, pay taxes and contribute to the American economy. They are, in all respects, Americans, except for this one thing: their citizenship status. They are our neighbors; they win our hearts; they should be American citizens.

Every element of this moment says “yes, it’s time to legislate a path to citizenship for the ‘dreamers.'” This may be a wonderful opportunity to accomplish the unthinkable — a bipartisan victory that legislates a positive program focused on a group everyone seems to care about. And the bipartisan Maine delegation can help it happen by co-sponsoring and helping pass the DREAM Act this month.

Would Trump sign it? He has already said, several times, that he sympathized with the DACA kids. He framed the issue as something Congress should do. If the DREAM Act passes with bipartisan support, even a quixotic Trump veto could be overridden.

Time to pocket the win-win on DACA.

Gordon Adams is professor emeritus at the American University School of International Service, a co-leader of Mainers for Accountable Leadership and a resident of Brunswick.