Seventeen years after the invasion of Iraq, the war remains a live wire for many voters in the Democratic Party.

Joe Biden, who was chairman of the Senate Foreign Relations Committee at the time, voted for the war ― along with 28 other Democratic senators and all but one Republican.

But Biden has been distancing himself from his vote, making it seem like he was against the endeavor from the beginning.

Biden had to defend his record on the Iraq War right at the top of the Democratic debate in Des Moines on Tuesday.

“I was asked to bring 156,000 troops home from that war. Which I did. I led that effort,” Biden emphasized.

“It was a mistake to trust that they [President George W. Bush’s administration] weren’t going to go to war. They said they were not going to go to war,” he added. “They said they were just going to get inspectors in. The world, in fact, voted to send inspectors in, and they still went to war. From that point on, I was in the position of making the case that it was a big, big mistake, and from that point on, I moved to bring those troops home.”

Mark Wilson/Getty Images Then-Sen. Joe Biden (D-Del.), right, supported deposing Iraqi leader Saddam Hussein in 2003 while George W. Bush was president.

Biden did not immediately start making the case that the war was a mistake. In 2005, Biden did start calling his vote for the war a “mistake.” But he continued to argue for staying in Iraq in 2004.

But over the past few months, Biden has repeatedly claimed that he was against the war from the beginning.

Most recently, in Iowa this month, Biden told voters that as soon as Bush “went ahead with ‘shock and awe,’ and right after that ― and from the very moment he did that, right after that ― I opposed what he was doing, and spoke to him.”

Similarly, in September, he told NPR that he supported Bush putting inspectors in Iraq, not waging a war.

“I got a commitment from President Bush he was not going to go to war in Iraq,” said Biden. “He looked me in the eye in the Oval Office; he said he needed the vote (authorizing the war) to be able to get inspectors into Iraq to determine whether or not (Iraqi dictator) Saddam Hussein was engaged in dealing with a nuclear program. He got them in, and before we know it, we had a shock and awe. Immediately, the moment it started, I came out against the war at that moment.”

Ari Fleischer was Bush’s press secretary at the time. In 2005, he wrote a book, “Taking Heat,” in which he talked about a Sept. 4, 2002, meeting at the White House where the president asked congressional leaders for support for a resolution of force against Iraq. He recounted an exchange between Bush and a “Democratic senator”:

We want to work with the UN, Bush said, otherwise we will have to act unilaterally. The President also told the group he believed Iraq could eventually be a democracy. One leading Democratic senator who later voted to authorize the use of force against Iraq told the President, “I will be with you on condition we level with the American people ― we’ll have to say [in Iraq] awhile.” “You’re right,” Bush said. “If you can get it done without staying, we’ll give you the Nobel Peace Prize,” the senator said. “I’ll support you for President,” he added. “I don’t know whether that will help me or hurt me,” Bush said to the room’s amusement.

The Democratic senator mentioned in the book is Biden. New York Times journalist Peter Baker used this same anecdote for his 2014 book, “Days of Fire,” and noted that he confirmed Biden’s identity with Fleischer.

Biden seemed skeptical a short commitment in Iraq was possible, so his Nobel Prize comments were, in that respect, in jest.

But in the exchange Biden gives Bush his support for an invasion; he certainly doesn’t come off as a senator who was against the use of force in Iraq.

A Biden aide denied the account in Fleischer’s book to HuffPost and said Baker never interviewed Biden either.

“Then-Senator Biden was not interviewed for this book, and we don’t infrequently disagree with Ari Fleischer,” the aide said. “In fact, Biden fought for legislation that would have forced Bush to first attempt to get U.N. approval for any military action and in its absence certify to Congress that there was no alternative course of action.”

But Fleischer stood by his account to HuffPost on Tuesday, going back and checking his notes from the time ― and providing more detail from the meeting.

Fleischer said that Biden told Bush he needed the “informed consent of the American people” and that it was the “world’s problem, not ours.”

Biden further told Bush that he was impressed with him. “I think you’re doing it the exact, right way. You have a little bit of time here. Check off all the boxes.”

It’s not clear what Biden thought Bush was doing the “right way” ― it could have simply been that Bush was trying to get congressional approval.

Tom Daschle, Dick Gephardt and Carl Levin, who were then top Democratic lawmakers, were also in the meeting. According to Fleischer, they “raised the most questions about Bush’s goals, mostly by asking what the plan would be after Saddam leaves. Daschle asked what new evidence there was. Levin [warned] that senior military leaders have concerns about an attack. ‘Saddam Hussein is a survivalist’ Levin warned Bush.”

He said Biden did not raise any other topics or ask more questions.

It’s not surprising that a Democratic presidential candidate would shy away from a record supporting the Iraq invasion. It’s a deeply unpopular war and has doomed other candidates with primary voters in the past. It’s been, in many ways, the defining litmus test for the party in recent years. And in recent days, Sen. Bernie Sanders (I-Vt.), who is among those challenging Biden for the Democratic presidential nomination, has been going after him for his war vote.

After his comments last September to NPR, Biden said he misspoke.

“I said I made a mistake trusting that he would not use force. ... The extent to which I misspoke was, my public statements were that we were doing this all the wrong way,” Biden said. “We should not have done it the way we did it, and we should be supporting the troops if they’re in there, but we should be getting an international coalition to support this, etc.”

“So, the misrepresentation was how quickly I said I was immediately against the war. I was against the war internally and trying to put together coalitions to try to change the way in which the war was conducted,” he explained.

But four months later, Biden was again portraying himself as a war critic, without any mention of his support for the invasion. And his campaign defended his comments, telling CNN he was “referring to how he immediately opposed the specific way we went to war ― without giving diplomacy and the weapons inspectors a chance to succeed, based on hyped intelligence, without sufficient allies and without a plan for the day after ― and the manner in which the war was being carried out.”

In the run-up to the 2003 invasion, Biden tried to figure out a compromise that would narrow the scope of the war authority that Bush wanted ― while still authorizing force. It was, in many ways, a classic Biden role of trying to forge a deal between two sides. But Biden also fought against alternatives from his more liberal colleagues that would have restricted Bush even further.

“I supported the resolution to go to war. I am not opposed to war to remove weapons of mass destruction from Iraq,” he said in a February 2003 speech. “I am not opposed to war to remove [Hussein] from those weapons if it comes to that.”

Biden added that while he believed it “may well be true” that the war would be “prosecuted quickly and successfully,” it would still “be a long haul” ― and the president needed to tell the public the facts.

“The point is, we have every reason to have faith in our military,” he said. “But while it is reasonable to expect the best, it would be irresponsible not to prepare for the worst.”

In the race for the 2008 Democratic presidential nomination, then-Sen. Barack Obama of Illinois ― who eventually chose Biden to be his vice president ― was scathing in his criticism of opponent Hillary Clinton and her attempt to “rewrite history” concerning her Iraq war vote as a New York senator (Obama wasn’t in the chamber when the vote occurred).

“She voted for a resolution called, and I quote, ‘a resolution to authorize the use of United States armed forces against Iraq.’ Now she’s saying that she wasn’t really voting for war,” he said. “She cast her vote after failing to read the national intelligence estimates on Iraq ― a report that raised enough doubts that the majority of Democratic senators who read it voted against the war.”

“We need accountability in our leaders,” Obama added. “You can’t undo a vote for war just because a war stops being popular.”

Correction: This piece originally identified Gephardt as a former senator. He served in the House.