After months of loud partisan public disagreement — and fierce haggling and horse-trading in private — Democrats and Republicans are finally moving, slowly but surely, toward passage of some version of the immigration bill known as the “DREAM Act.”

The precise terms of the new legislation are still being worked out, but neither liberal Democratic supporters of a separate legalization program for undocumented immigrant minors — nor far right opponents of anything resembling an “amnesty” for “law-breakers” — are likely to be completely satisfied with the outcome.

For one thing, the number of DREAMERs that will qualify for legal status will likely fall far short of the two million or more granted a temporary stay of deportation by President Barack Obama in an executive order issued in 2012. Those immigrants who do qualify, probably about a million all told, will face a number of high hurdles. They won’t be eligible to become citizens right away. And if they lose their jobs, end up on public assistance or fall behind on their taxes, they can still be sent home.

To secure bipartisan support, the legislation may also include a host of new provisions to toughen immigrant enforcement. For example, President Donald Trump and the GOP want to extend the current fencing along the border between the US and Mexico. Insiders say that the White House won’t be demanding the whole enchilada – “The Wall” — just now. But expect Trump’s nationalist rhetoric to be loud enough to satisfy the rabid and loyal GOP base that got him elected – and that continues to keep his approval rating in the high 30-percent range.

The new immigration legislation is just the latest sign of how much the policy debate over immigration has shifted away from the Democrats in recent months.

In the face of a relentlessly hostile mainstream news media, Trump won an important victory three weeks ago when the U.S. Supreme Court upheld the latest iteration of his “Muslim travel ban.” The measure no longer targets “Muslim” countries by name, though all of the countries designated are majority Muslim. Essentially, Trump repackaged the idea to satisfy his most vociferous critics — and to square the measure with anti-discrimination laws.

Trump has also succeeded in slashing annual refugee admissions in half, from 100,000 to just 45,000, a historic low. And he is quickly moving to eliminate the “diversity” visa lottery that allows 50,000 people from historically neglected areas of the world to obtain a green card.

The bipartisan Jordan Commission called for the diversity visa lottery’s elimination as far back in 1995 but, to date, Democrats have beat back Republican efforts to end the program, insisting, without much evidence, that it boosts America’s standing overseas. Republicans have attacked the program as a political “fig leaf” that adds no value to the U.S. economy.

Trump seems to be moving the Congress — and the country — toward some kind of historic compromise on immigration reform, one that steers a path between the mass deportation demanded by far right Republicans and the sweeping amnesty promoted by liberal Democrats.

Some undocumented immigrants will be allowed to stay, under restricted terms, possibly without a path to citizenship. At the same time, stepped up immigration enforcement will tighten the noose and expedite the deportation of many of those here illegally. Perhaps half of the undocumented population currently in the US will be sent home or convinced to “self-deport.” (Immigration arrests are up 40 percent over last year)

There’s a real irony in Trump’s decision to let most of the DREAMers stay. For years even President Obama maintained that congressional legislation was the only way to ensure that the DREAMers would be granted relief. When pressed by immigration activists to issue an executive order in 2010-2011, he insisted that, constitutionally, his hands were tied.

Obama’s intransigence eventually exasperated those same activists who began a wave of “sit-ins” at congressional offices. The confrontation reached a climax when the DREAMers began reaching out to Republicans like Florida Sen. Marco Rubio just prior to the 2012 election. Some even talked about sitting out the contest altogether and letting Obama’s reelection go down the tubes.

The White House hastily drafted an executive order that allowed the DREAMers to stay. The maneuver worked. Latinos not only returned to the fold but voted in record numbers to help Obama win, in part by carrying Latino-rich Florida and the Hispanic Southwest.

The pattern was repeated in 2014, when Congress continued to resist passage of an immigration compromise that would extend citizenship to the undocumented. On the eve of the mid-term elections, Obama extended his executive order beyond the scope of the DREAMers, adding several more million to the list of those granted a stay of deportation.

Trump, during the 2016 campaign, attacked both Obama orders as “usurpations.”

And yet Trump, almost from the beginning — and to the consternation of some Republicans — has decided that the DREAMers are a special case. He is well aware that the Pentagon views the DREAMers as a source of fresh military recruits. And his own vice president, Mike Pence, has long pushed to extend a DREAM-like deferment to the undocumented spouses of American soldiers.

Trump himself has obvious sympathy for the plight of immigrant children. Only a partisan cynic can deny that. He did rescind Obama’s executive orders as a matter of principle. However, upon doing so, he asked Republicans in Congress to work with the Democrats to find a legislative compromise — an effort that may finally bear fruit

The proposed bill, however it finally takes shape, is no small breakthrough. It will likely position Trump as a bipartisan deal-maker on an issue that has fiercely divided the country for well over a decade. Eventually, it could well pave the way for Trump and the Republicans to take full command of the immigration issue, much as Ronald Reagan and the GOP did in 1986 with passage of the last major immigration overhaul.

And on the heels of a successful battle for tax reform, it gives Trump and the Republicans more political wind at their back as they head into next year’s fiercely contested mid-term elections, anxious to preserve their current majority in the House and Senate.

Stewart Lawrence is a consultant and policy analyst.

The views and opinions expressed in this commentary are those of the author and do not reflect the official position of The Daily Caller.