This week, New York lawmakers did what some of their New Jersey counterparts have been trying to do for more than a decade: They passed a law making undocumented immigrants eligible for driver’s licenses.

New York became the 13th state to allow undocumented immigrants to take a driver’s test, after nearly two decades of lobbying by immigrant advocates. Delaware, Maryland, and the District of Columbia are among other places that do the same.

Undocumented immigrants elsewhere often drive without licenses — and car insurance — or find other means of transportation. Nearly a half-million undocumented immigrants in New Jersey are of driving age, according to liberal think-tank New Jersey Policy Perspective.

Gov. Phil Murphy and state Senate President Stephen Sweeney (D., Gloucester) have said they support the licensing effort in New Jersey. With Democrats’ control of state government, advocates have been hopeful about passing a law like New York’s. But New Jersey’s bills have been stuck in committees since lawmakers introduced them in December.

“The vote in New York is a historic victory for immigrant rights" and “welcome news” in New Jersey, said Sara Cullinane, director and cofounder of Make the Road New Jersey, an immigrant advocacy organization. She said the issue is the number-one priority for her members.

“It’s an issue that gets them up out of bed at 6 in the morning to lobby in Trenton," she said. "It keeps them up at night worrying if they’ll be detained for dropping their kids off at school or taking them to a doctor’s appointment.”

Opponents in New York and New Jersey say people who are living in the country illegally don’t deserve driving privileges. And while acknowledging that “not every person in the country illegally is a security threat,” Republican lawmakers representing parts of Burlington, Atlantic, and Ocean Counties have said homeland security is at stake. They say “outraged” constituents have complained to them.

Mariolys Mendoza, 51, an undocumented immigrant who has lived in Elizabeth, Union County for just over a year, said the New York driver’s license law shows “the time is now” for New Jersey. She said she fled violence in her native Venezuela and is seeking U.S. asylum. Mendoza said having a driver’s license would help her and her family members get to their English classes, doctor’s appointments, and work. She has advocated for the New Jersey bills at meetings in Trenton, marches, and rallies, including one on Father’s Day.

The bills would create two tiers of driver’s licenses and identification cards — REAL ID-compliant cards and standard cards. Standard cards would not require proof of legal residency.

The legislation would not allow undocumented immigrants to use driver’s licenses to receive state services or register to vote, since they are not citizens.

In April, Philadelphia began offering municipal identification cards to all residents — including undocumented immigrants.