AUGUSTA — A bill to bring Maine into compliance with federal Real ID standards is headed to the governor’s desk.

On Tuesday, the Maine Senate gave final approval to legislation directing the Secretary of State’s Office to begin designing next-generation driver’s licenses and state-issued identification cards that meet the minimum security standards under Real ID. The bill, L.D. 306, allows state residents to opt out of receiving a Real ID-compliant driver’s license or identification card.

The legislation is aimed at avoiding a situation in which Maine residents are no longer able to use their driver’s licenses to pass through airport security or to gain access to federal facilities next year because the state’s licenses do not comply with the federal standards, such as digitized photos that can be used with facial recognition technology. Already, some Maine veterans who use a U.S. Department of Veterans Affairs health facility in New Hampshire, as well as contractors at federal defense facilities, have been turned away.

Sen. Bill Diamond, a Windham Democrat and former secretary of state, said he’s been assured by federal officials twice that those restrictions will end as soon as the state begins working toward Real ID compliance. Additionally, the federal government will offer Maine an extended waiver to allow state residents to continue using noncompliant ID cards beyond January 2018, which is when additional prohibitions were slated to begin unless the Legislature acted this session.

“Passage of this bill will guarantee Mainers have the same ability to come and go as they please that any other United States citizen enjoys,” Diamond, the sponsor of L.D. 306, said in a statement. “In my communication with the Department of Homeland Security, I’ve been assured that passage of this law will end these punitive enforcement actions and free Maine veterans and other residents to go about their business. People expect their elected officials to solve the problems they face. This law avoids a bureaucratic nightmare that would have brought normal life in Maine to a grinding halt.”

Republican Gov. Paul LePage has called on the Legislature to pass Diamond’s bill fixing the Real ID issue and vetoed a stop-gap measure intended to help veterans being turned away from the New Hampshire VA facility because it did not go far enough. He is expected to sign the bill, although he has 10 days to sign, veto or allow the bill to become law without his signature.

Maine is one of a handful of states that have refused to comply with the Real ID law, which federal officials insist is necessary to help thwart terrorism. Under Real ID, states must use digitized images of cardholders that are compatible with facial recognition software and must maintain a database of birth certificates, photographs and other records. But Real ID opponents have questioned the constitutionality of the requirement and argued that maintaining a database of personal information – such as Social Security numbers, birth certificates and other documents – puts Mainers’ information at risk from hackers.

Maine’s current secretary of state, Matt Dunlap, led the fight against Real ID in the Legislature. Dunlap said Tuesday that it will take time and money – estimates are from $2 million to $3 million – to redesign driver’s licenses and acquire all of the scanners, software and other equipment necessary to make the switch.

Dunlap said he believes the state could begin issuing the new Real ID-compliant licenses and identification cards by July 1, 2019, calling that a “realistic timeframe” absent any major roadblocks. Mainers who don’t opt out would not have to get the new licenses until their current ones expire.