Erie County Clerk Mickey Kearns has filed a lawsuit against Gov. Andrew Cuomo for approving a controversial state law granting driver’s license privileges to illegal immigrants that would force county clerks to defy federal law.

The Green Light Bill passed the Senate 33-29 before Cuomo signed it into law June 17.

The case, which was filed in US Western District court in Buffalo, lists Cuomo, state Attorney General Letitia James and Department of Motor Vehicles Commissioner Mark Schroeder as defendants.

Kearns, a Democrat, claims he’s caught between a rock and a hard place.

He argued that the Green Light Law puts him in direct conflict with federal immigration law, but also puts his job at risk as Cuomo has the power to remove him from his position.

“As Clerk of the County of Erie, Mr. Kearns is required to carry out the Green Light Law. If he fails to do so he is at risk of enforcement or removal from office, or both by Governor Cuomo, Attorney General James, and/or Commissioner Schroeder,” the suit reads.

“But if Mr. Kearns carries out his duties under the Green Light Law, he faces the credible threat of criminal prosecution by federal authorities. Mr. Kearns, therefore, cannot carry out his duties under New York law without violating federal immigration law, and visa versa.”

Kearns argues that the law is unconstitutional and forces him to conceal records and information from federal authorities.

Even Gov. Cuomo said the legislation, which he approved, is “very questionable,” Tuesday during a WAMC ‘The Roundtable” interview.

“If the federal government sues for access to the database, or the FBI sues for access, or the Department of Justice sues for access and wins, that would be a different situation. That’s the question I posed to the Solicitor General and the Attorney General. Will we win?”

“You can’t be unwittingly subjecting yourself to federal deportation,” he added.

But Attorney General James poo-pooed the concern, insisting the law will stand in court and a warrant is needed to access the database.

“The Green Light law is well crafted and the Office of [the] Attorney General has concluded that it is constitutional. As the state’s attorney and chief law enforcement officer, my office will vigorously defend it,” she said in a statement.

Bill sponsors have argued the legislation brings immigrants “out of the shadows” and allows families to partake in everyday tasks like driving to school.

But Republicans and law enforcement critics contend the measure encourages voter fraud.

Polls show a majority of voters oppose giving driver’s licenses to illegal immigrants.

“The truth is that this misguided and dangerous law never should have been enacted in the first place. Democrats, especially those who represent the suburbs and Upstate New York, ignored the overwhelming majority of their own constituents who strongly opposed this policy,” argued state Senate GOP Leader John Flanagan (R-Suffolk).

Cuomo, James and Schroeder have 21 days to respond to the summons to appear in court.