Sen. Bernie Sanders voted against the 2003 Iraq War. Another 2020 Democratic contender, Joe Biden, voted for the war.

Wednesday marked the 16th anniversary of the US invasion, and Sanders took the opportunity to tout his record against the war in social media posts.

Sanders tweeted, "I opposed the war and it gives me no pleasure to say that much of what I feared came true. Our foreign policy must focus on diplomacy, not endless war."

A majority of Democratic voters believe the US made the wrong choice by using military force in Iraq, according to polling.

On the sixteenth anniversary of the US invasion of Iraq, Sen. Bernie Sanders said it gives him "no pleasure" to say that much of what he feared would happen as a consequence of a war he voted against has come true.

"In the 16 years since the Iraq war began, we've lost many thousands of American and Iraqi lives and spent trillions of dollars," Sanders said in a tweet on Wednesday. "I opposed the war and it gives me no pleasure to say that much of what I feared came true. Our foreign policy must focus on diplomacy, not endless war."

Read more: Bernie Sanders' foreign policy adviser breaks down the senator's progressive global agenda for 2020

As he spoke out against the conflict in October 2002 on the Senate floor, Sanders said, "War must be the last recourse in international relations, not the first."

At the time, the Vermont senator offered five reasons why he would vote against the war:

"I have not heard any estimates of how many young American men and women might die in such a war or how many tens of thousands of women and children in Iraq might also be killed ... we should do everything we can to prevent the horrible suffering that a war will cause."

"I am deeply concerned about the precedent that a unilateral invasion of Iraq could establish in terms of international law and the role of the United Nations. If President Bush believes that the U.S. can go to war at any time against any nation, what moral or legal objection could our government raise if another country chose to do the same thing?"

"The United States is now involved in a very difficult war against international terrorism as we learned tragically on September 11 ... I agree with Brent Scowcroft, Republican former national security advisor for President George Bush, Sr., who stated, 'An attack on Iraq at this time would seriously jeopardize, if not destroy, the global counterterrorist campaign we have undertaken.'"

"At a time when this country has a $6 trillion national debt and a growing deficit, we should be clear that a war and a long-term American occupation of Iraq could be extremely expensive."

"I am concerned about the problems of so-called unintended consequences. Who will govern Iraq when Saddam Hussein is removed and what role will the US play in ensuing a civil war that could develop in that country? Will moderate governments in the region who have large Islamic fundamentalist populations be overthrown and replaced by extremists? Will the bloody conflict between Israel and the Palestinian Authority be exacerbated? And these are just a few of the questions that remain unanswered."

The US invasion of Iraq was initially justified under intelligence, which ultimately proved to be false, that suggested Saddam Hussein had weapons of mass destruction (WMDs).

Instead of starting a war, Sanders urged the US to cooperate with the international community and institute a thorough search for such weapons in Iraq. This was not the route the US would end up taking.

Former Vice President Joe Biden, who was a US senator for Delaware at the time of the invasion, voted in favor of it back in October 2002.

Biden is expected to run in 2020, and his record on Iraq could come back to haunt him as he's asked about global affairs along the campaign trail. Recent polls place Sanders and Biden at the top of the race for the Democratic nomination.

Read more: Joe Biden voted for the Iraq War, which started 16 years ago today, and his support could cause problems for his long-rumored 2020 presidential run

Sanders faced a fair amount of criticism when he ran in 2016 from those who felt he didn't focus on foreign policy enough, but he's since worked to make it more of a priority.

Sanders and Biden are the only declared or prospective 2020 candidates who cast a vote for or against the war. Democratic Rep. Tulsi Gabbard, who's also running in 2020, is an Iraq War combat veteran.