DES MOINES, Iowa (Reuters) - U.S. presidential candidate Bernie Sanders contrasted his record with that of Hillary Clinton on key issues, including his early support for same-sex marriages and consistent opposition to the Iraq war, during a Democratic fundraising dinner in Iowa on Saturday.

Slideshow ( 9 images )

The annual dinner in the early-voting state has become a bellwether of Democratic support, and it was the first time that Sanders, Clinton and former Maryland Governor Martin O’Malley have appeared on the same stage since the first Democratic debate on Oct. 13.

While the debate was a largely genial affair in which the candidates complimented one another and disagreed on policy specifics, Sanders used the Jefferson-Jackson dinner, attended by more than 6,000 Democrats, to highlight differences with front-runner Clinton, without mentioning her by name.

The U.S. senator from Vermont, who calls himself a democratic socialist, has gained on Clinton in recent polls.

Sanders spoke first and reminded the crowd of his early support for same-sex marriage, his vote against the U.S. war in Iraq, his criticism of trade pacts and called opposing the Keystone XL pipeline to bring Canadian oil to the Gulf of Mexico a “no brainer.”

Each point was a nod to previous positions taken by Clinton or her husband, former President Bill Clinton, who appeared for the first time on the campaign trail in Iowa on Saturday.

Bill Clinton signed a 1996 law, which has since been overturned by the U.S. Supreme Court, that prevented same-sex couples from receiving federal spousal benefits.

Hillary Clinton, as a U.S. senator from New York, voted to invade Iraq, but says based on what she knows now that was a mistake.

Clinton recently opposed the Trans-Pacific Partnership trade pact negotiated by the Obama administration and the Keystone pipeline, which is under review by the U.S. State Department. Both processes began when Clinton held the top post at the diplomatic agency.

A victory in Iowa, which holds the first party-nominating contest on Feb. 1, can set the tone of a presidential campaign. President Barack Obama delivered a breakout performance at the 2007 Jefferson-Jackson dinner as a relatively unknown U.S. senator from Illinois. He went on to win the state.

“About eight years ago all of the political experts talked about how another Democratic candidate for president just couldn’t win, he was unelectable,” Sanders said on Saturday. “Remember that guy? What was his name? Oh, it’s President Obama.”

“Well Iowa, I think we are going to prove the pundits wrong again,” Sanders added, drawing some of his strongest applause of the night.