Some upstate New York county clerks are taking a stand against the state’s controversial new law granting driver’s licenses to illegal immigrants.

Clerks in Erie, Rensselaer, Niagara and Allegany counties have said they won’t be handing out the licenses, despite the legislation signed Monday by Gov. Andrew Cuomo.

Erie County Clerk Michael Kerns said he believes the Green Light Bill, which passed the state Senate 33-29, conflicts with federal policy — and is ready to go to court with his concerns.

“In the memo of the bill, they talk about the reason why they’re passing this bill is to make sure that people who are here illegally can get to and from work,” Kerns said. “It is illegal to hire people in the state of New York or anywhere that are here illegally.

“There’s an inconsistency there.”

Buffalo-area motor vehicle agencies will instead direct applicants believed to be in the country illegally to the state-run auto bureau in Syracuse, about two hours away, Kerns said.

The county clerk said he knows the governor can strip him of his position.

Cuomo’s office did not respond to a request for comment.

State Attorney General Letitia James has said her office is prepared to defend the measure if it is challenged in court.

It’s unclear what the potential sanctions are for clerks who don’t enforce state law.

The law goes into effect in six months.

With Post wires