On Thursday, President Trump put his immigration cards on the table with the proposal for a grand compromise.

The main terms are that 1.8 million illegal immigrants could immediately begin a path to legalization and, in most cases, citizenship.

At the same time, Trump would secure $25 billion for the border wall he promised during his presidential election campaign, stricter enforcement for visa overstays, and a narrowing of those eligible for naturalization based on family relations — that is, an end to “chain migration” as it is currently practiced.

Not everything in this initial ask is a real solution to the immigration problems. For example, the proposal reportedly results in a 25 percent reduction in legal immigration, which would only make existing problems worse with illegal immigration. But such details can be worked out in negotiation.

The more important fact is that this deal, as broadly outlined, puts Democrats and Republicans in a situation where each party’s members of Congress have to prove their bona fides.

Republicans nearly all claim now that they want to help the so-called “Dreamers,” illegal immigrants who were brought to the U.S. as children, before the Deferred Action for Childhood Arrivals program currently protecting them expires. The deal Trump has advanced forces the Republicans to show they are serious about helping these 1.8 million mostly younger immigrants gain legal footing for life in the only country they have ever known.

Democrats, meanwhile, are ever claiming to oppose the decadeslong disorderly and dangerous scramble across the southern border that has resulted from insufficient enforcement. They often cite it as the unwanted alternative to an immigration amnesty. Well, Trump’s proposal provides Democrats with a chance to prove that they’re serious about what they say by actually supporting border security measures that won’t prevent anything except chaos at the border.

Given the March 5 deadline looming for DACA’s expiration, both parties are going to have to come to terms quickly. In true Washington fashion, this will come down to a must-pass bill whose failure will have catastrophic consequences, and that might be what’s necessary for the deal to work.

Trump’s team believes (and an appellate court has ruled) that he lacks the legal standing to extend the DACA program beyond the deadline. And so if you’re for helping the Dreamers at all, you’re for whatever deal leaders in Congress hammer out.

Republicans are already suffering a campaign by nativist groups to make them reject any plan that regularizes the 1.8 million immigrants in the deal.

Democrats will surely come under even more pressure to reject any plan that involves Trump, in order to deny him any sort of achievement. They also have an interest in keeping the Dreamers around as an issue, as their cause is by far the most popular item on Democrats’ immigration agenda.

The public broadly supports legalization for childhood arrivals, and yet the bases of both parties will fight to prevent it. So here’s an early test of whether anything can really get done in Washington. Members of both parties are going to have to win out over their baser political instincts, and they have only until March 5 at the very latest to make it happen.