ALBANY — The New York State Senate approved a bill on Monday to grant driver’s licenses to undocumented immigrants, a deeply polarizing issue that had splintered Democrats and stirred a backlash among Republicans in New York and beyond, who have already vowed to highlight it during next year’s elections.
The vote, together with the Assembly’s passage last week, thrust New York into the center of the explosive national debate over immigration. It would reverse a nearly 20-year-old ban and end years of political paralysis on the issue.
It also signaled the strength of the progressive wing of the Democratic Party, which for months had pressed moderate legislators to support the bill despite concerns about alienating swing voters, especially among first-term Democrats who flipped seats on Long Island and helped their party win a majority last year.
As recently as last week, resistance from those new legislators had stalled the bill. But with three days remaining in the legislative session, a combination of aggressive activism, emotional appeals and last-minute affirmations from some of those lawmakers helped usher through the proposal.
The bill passed with just one more vote than the minimum needed, 33 to 29. Gov. Andrew M. Cuomo, a Democrat, signed the bill soon after.
When the last vote was cast just after 8:30 p.m., immigration rights activists who had remained throughout the nearly four-hour debate erupted into cheers, forcing the Senate’s presiding officer to gavel them down.
“It’s been an 18-year struggle,” said Javier Valdés, the co-executive director of Make the Road New York, a prominent immigrant advocacy group. “The resilience of the immigrant community has shown through once again.”
Twelve states and Washington, D.C., currently allow undocumented immigrants to drive. New Jersey is weighing a similar proposal.
In New York, even with Democrats in control of both houses of the Legislature and the governor’s office, political anxieties had threatened the bill’s prospects. On Monday, just hours before the proposal passed the Senate, Mr. Cuomo said in an interview on WAMC radio that the bill had significant potential ramifications.
“This bill is basically seen as a pro-immigrant bill,” he said. “So there’s no doubt that there’s a political downside.”
Indeed, even before the so-called Green Light bill came to a vote, opponents had promised a political price. Last week, the National Republican Congressional Committee criticized Representatives Max Rose, Antonio Delgado and Sean Patrick Maloney, all Democrats of New York, for not denouncing the state’s driver’s license proposal.
Several county clerks, who issue driver’s licenses in New York, also denounced the bill, with at least one vowing to defy it if it became law.
During the debate in the Senate on Monday, outraged Republicans said the bill would reward people for entering the country illegally.
“If we give them every right they have, they will not be incentivized to go through the process of getting that greatest gift, to be a citizen,” Senator James Tedisco, a Republican from central New York, said.
Senator Frederick J. Akshar, of the state’s Southern Tier, said the bill was “only continuing this state’s trend toward favoring criminals over law-abiding citizens.”
Many of the Democrats seemed intent on minimizing the more partisan elements of the proposal. Andrea Stewart-Cousins, the leader of the Senate Democratic majority, emphasized the public safety and fiscal implications of the bill, rather than the social justice ones.
“By passing this needed legislation, we are growing our economy while at the same time making our roads safer,” she said in a statement. “This is the right step forward for New York State as we continue to advocate for comprehensive immigration reform on the federal level.”
But others offered impassioned defenses of the rights of the estimated 940,000 undocumented immigrants in New York, the third-largest population in the country, according to the Migration Policy Institute, a nonprofit group.
“We keep hearing illegal, illegal, illegal. And it angers me, infuriates me, because no human being is illegal,” Senator Andrew Gounardes, who defeated a Republican in South Brooklyn last year, said. “We dehumanize and we delegitimize people who are our brothers and sisters in humanity.”
Senator Luis Sepúlveda, the bill’s sponsor, said immigrants were “the backbone of this state and country.”
He added, “You deserve to live a life without fear.”
Earlier Monday, Mr. Cuomo had expressed concern that the bill would create a database of the undocumented, making them vulnerable to the federal government. He suggested that he might veto the bill unless the state solicitor general said otherwise.
But the state attorney general, Letitia James, who oversees the solicitor general, said in a statement several hours later that the bill afforded “ample protections” for immigrants. Mr. Cuomo’s office said he would sign the bill shortly after.
The debate over driver’s licenses has a long, fraught history in New York. Before 2001, immigration status did not determine eligibility for a license. But after the Sept. 11 attacks, Gov. George E. Pataki, a Republican, issued an order requiring applicants to have a Social Security number, citing fears about national security.
In 2007, Gov. Eliot Spitzer, a Democrat, announced that he would undo that policy — only to retract the proposal two months later, in the face of plummeting approval ratings and fierce backlash from across the country, including prominent liberals such as Hillary Clinton and Kirsten Gillibrand.
The bill’s passage on Monday followed weeks of intense negotiations in the Senate.
Its fate had seemed uncertain last week, especially after Jay Jacobs, the leader of the state Democratic Party, publicly urged suburban senators not to support it. Mr. Jacobs, a staunch ally of Mr. Cuomo, warned that they would endanger the Democrats’ new majority in the Senate, which Republicans have controlled for most of the last half-century.
Polls had also shown that less than half of New Yorkers supported the idea, and law enforcement officials and Republican leaders had denounced Democrats for prioritizing the undocumented and undermining the rule of law.
But activists over the past few months had waged a vigorous campaign to change public opinion. They knocked on thousands of doors on Long Island; won statements of support from business groups, insurance agencies and some law enforcement officials; and promoted statistics showing that the proposal could reduce hit-and-run incidents, drive down insurance rates for all New Yorkers and generate some $50 million in revenue for the state each year.
They also alternated between wooing and threatening Democratic lawmakers — praising them for their stated commitment to social justice, or reminding them of the role grass-roots groups had played in their elections last fall.
“Our Democratic State Senate was elected by the people for these kinds of votes,” Steven Choi, the executive director of the New York Immigration Coalition, said.
A key turning point came on Thursday, when the Senate Democrats discussed the proposal in a closed-door meeting the day after the Assembly passed it. During that meeting, Senator Anna Kaplan, who unseated a Republican on Long Island in November, said that the bill was the right thing to do, according to three people familiar with the exchange.
But in yet another illustration of the perceived political dangers of the bill, Ms. Kaplan ultimately voted against the bill, as did all of her fellow Long Island senators and one Democratic senator from the Hudson Valley.
But by then, a drumbeat of other victories had also helped changed the calculus. A poll released last week by Siena College showed that while the proposal was still highly divisive, support in the suburbs had grown by more than 10 points in the previous months. A different survey, sponsored by Make the Road and conducted by a liberal polling group, found that 55 percent of New Yorkers supported the idea.
Proponents also emphasized that the bill would not provide a path to citizenship and would not enable licensees to board planes.
But perhaps most of all, they cited President Trump, and how his hard-line anti-immigrant policies had galvanized the left.
“The national climate has changed drastically” since 2007, Mr. Valdés said. “A lot of other states looks to New York to see how far we can push the envelope in protecting the immigrant community.”
He added: “Democrats are realizing that this is the one policy the state could do that would impact the immigrant community the most. And they cannot go back home without having addressed this.”