Just when Washington looked like it was completely preoccupied with the scandals, real and imaginary, swirling around the White House, a group of Democrats and Republicans in the Senate managed the unexpected (and, these days, extraordinary): They agreed on something. The vote Tuesday night in the Senate Judiciary Committee to forward to the floor a massive overhaul of the nation's immigration system was, to be sure, a small step and doesn't guarantee success in the full Senate, much less the House of Representatives. But it is, at least, a hopeful sign that gridlock in this divided government is not inevitable.

From a policy standpoint, the need for immigration reform is acute. Some 11 million people are in this country illegally, and they are not going away. But without reforms to the system, they are underutilized. Immigrants tend to be strivers and entrepreneurs, and they can be an important catalyst to the nation's economic growth. But the lack of legal status relegates them to a shadow economy, limiting their ability to contribute. The immigration bill corrects that flaw by providing a pathway to citizenship — albeit not a quick or easy one — and by shifting the system away from one based on family preferences to one that takes the skills of potential immigrants into greater account. Indeed, one of the key compromises in the Judiciary Committee was an agreement to increase the number of H1-B visas given to highly skilled workers.

The Social Security Administration estimated this month that the bill would create 3.2 million jobs and boost the gross domestic product by nearly 1.7 percent over the next decade. The legislation's effects on population growth would actually strengthen Social Security's finances, the administration reported. A recent Heritage Foundation report claiming that the bill would increase federal deficits by $6.3 trillion has been widely disputed — even among conservatives — for failing to take into account the economic growth associated with immigration reform.

Politically, the time is also right. Republicans saw Hispanic voters' strong support for Democrats, including President Barack Obama, in November's elections as a warning sign. According to the Pew Research Center, Latinos made up about 10 percent of the electorate in 2012 — a record — but thanks to population growth and age dynamics, their share of the electorate could double within a generation. Unless Hispanics' preferences change, that dynamic could quickly make Florida more safely Democratic in presidential elections, Arizona could become a swing state, and even the Republican hold on Texas could eventually be at risk. Some Republican strategists have worried, not without reason, that continued harsh anti-immigrant rhetoric could ultimately sink the GOP as a national party. By the same token, Democrats recognize that they cannot afford to let slip the opportunity for reform and a path to citizenship.

The result, at least so far, is that both sides appear more intent on getting something done than on blaming the other side for failure. Sen. Charles Schumer, a New York Democrat, worked to find a compromise with Utah Sen. Orrin Hatch, a Republican, over the number of H1-B visas, even though doing so brought a swift rebuke from organized labor. Mr. Hatch and fellow Republican Sens. Jeff Flake of Arizona and Lindsey Graham of South Carolina joined with Judiciary Committee Democrats to defeat an amendment proposed by Texas Republican Sen. Ted Cruz to allow immigrants here illegally to become permanent residents rather than citizens. Senate Minority Leader Mitch McConnell said after the judiciary vote that he will not seek to block floor debate on the bill, even as a variety of conservative groups have urged him to do so.

And in what may have been the most wrenching compromise, Vermont Democratic Sen. Patrick Leahy decided not to offer an amendment that would have allowed American citizens to petition for green cards for their same-sex partners. He is absolutely right that anything less is an injustice. However, it was clear that including the amendment would have scuttled Republican support for the bill and likely doomed its chances of ultimately becoming law, and Democrats did the right (if unfortunate) thing by deciding not to push for it. The core issue there is the federal government's lack of recognition for same-sex marriages, and that can and must be addressed in other arenas. But it would be a shame to let that necessary debate overtake the chance for immigration reform.

A bipartisan group has also been working on immigration reform in the Republican-controlled House, but progress appears to have stalled. The best chance to move forward is for the Senate to provide a strong, bipartisan majority for its measure. House Speaker John Boehner has responded to that kind of pressure in the past, and on an issue as important as this one, there is reason to hope he will do so again.