WASHINGTON – In a stunning admission, former Gov. Eliot Spitzer says he buried a plan to give drivers’ licenses to illegal immigrants just to help Hillary Clinton’s presidential campaign back in 2007.

The licenses became a key issue in Clinton’s nomination fight with Barack Obama, who said he was for the licenses at a debate in Philly, while Clinton danced around taking a position.

“She waffled and waffled and waffled,” recalled Spitzer, who backs Democratic rival Martin O’Malley for president.

“It didn’t poll well, but there was no ambiguity about what was right,” Spitzer told former Obama advisor David Axelrod in a podcast Thursday for the University of Chicago’s Institute of Politics.

“I thought the issue was a metaphor for her vacillation,” he continued.

Clinton got quizzed on the issue after Spitzer pushed it nearly a decade ago, having said it “makes a lot of sense.”

But after other candidates pounced, she came up with a contorted answer where she wouldn’t quite come out for the licenses – even as she defended Spitzer’s effort to solve the problem. “What is the governor supposed to do?” she asked.

Speaking Thursday, Spitzer said he is “ashamed” of what he did next.

“We pulled the proposal” after “we heard from folks who said they want this issue gone” – meaning Clinton’s camp.

Spitzer also hit Clinton for coming out for a trade deal she had praised in the past, saying she “has not only completely reversed her policy, but is claiming that’s not what she said.”

He also dinged her on foreign policy.

“Why is that her reset with Russia, we now have Putin dominant as a player in the Middle East? You know, the pivot to Asia. There are a lot of things that I think are going to be legitimate questions that are substantive questions that deserve to be debated,” he said.

By way of disclosure, Axelrod, who once did consulting work for Spitzer, pointed out that “you’re divorced now and your current companion works for Gov. O’Malley,” a reference to advisor Lis Smith.

Spitzer responded: “Yes, everybody knows that. Yes. Correct. I am biased and overtly so. And proudly so.”