After a heated debate that extended through the night, members of the Connecticut Senate approved legislation that would allow undocumented immigrants to obtain driver's licenses, register their vehicles and get insurance.

The state Senate passed the bill by a vote of 19 to 16 on Thursday morning and it will move to Gov. Dannel Malloy, who is expected to sign it.

“This bill is first and foremost about public safety. It’s about knowing who is driving on our roads, and doing everything we can to make sure those drivers are safe and that they’re operating registered, insured vehicles." Malloy said in a statement.

The House had also passed the bill in the early hours of the morning with a 74-55 vote.

Supporters said the legislation would create millions of dollars in state revenue and make the roads safer.

“Allowing undocumented drivers to get a license ensures that they are just as accountable to the laws of our roads as everyone else. This bill allows people to carry out their lives while encouraging them to be safe and properly ensured while on the road.” Senator Terry Gerratana (D-New Britain) said in a statement.

Opponents said more research should have been done on the bill.

State Rep. Themis Klarides last week called the process the bill came through the state Legislature "irresponsible" and "disappointing."

“Without a study or any effort to thoroughly vet this concept, we can only speculate the impact this bill will have on homeland security, public safety, insurance policy holders and insurance companies. Perhaps even more troubling is that we have no plan to allocate the financial and staff resources needed for the DMV to manage the colossal influx of demand that will cripple their day-to-day operations,” she said in a statement.

“Connecticut would be the only state on the east coast to allow such a program, making the state a magnet for illegal immigrants who bring with them a host of increased costs to state government,” State Rep. David Scribner said in a statement.

Mayor John DeStefano Jr., an outspoken advocate for immigration reform, took on the issue seven years ago by offering undocumented immigrants resident identification cards and released a statement in support of the legislation.

"Like the municipal ID, granting immigrants driver licenses regardless of immigration status is good policy. Drivers’ licenses will reduce the number of uninsured motorists on the road and will establish training and testing standards to ensure driver safety. Moreover, like the Elm City ID, drivers’ licenses can help connect immigrants with banking services to help reduce street crime, increase the reporting of crime and help to create a sense of community identity,” DeStefano said in a statement.

More than 10,000 cards have been issued since the program's inception and the ID cards have gone a long way in strengthening relationships between residents and the city’s police department, DeStefano said in March.

"“It should also be noted that, like many issues, action on the federal level would address this problem in an even more comprehensive and sensible way. I continue to support those broader efforts at national reform, and urge Congress to follow the example being set by Connecticut and other states,” Malloy said in a statement.