DES MOINES, Iowa — A pointed exchange between the two leading progressive candidates running for president underscored the tension of Tuesday's debate, just weeks before Iowa voters kick off the Democratic nominating process with the first-in-the-nation caucuses.

But a rift emerged this week over a 2018 conversation in which Sanders allegedly told Warren he did not believe a woman could win the White House, spilling onto the debate stage and threatening to end whatever détente the two contenders had reached.

Before Tuesday's debate, Sanders denied he made the comment; Warren said he did. On Tuesday night, they stuck to their assertions.

"Well, as a matter of fact, I didn't say it. And I don't want to waste a whole lot of time on this, because this is what Donald Trump and maybe some of the media want. Anybody knows me knows that it's incomprehensible that I would think that a woman cannot be president of the United States," Sanders said.

"Bernie is my friend, and I am not here to try to fight with Bernie. But look, this question about whether or not a woman can be president has been raised, and it's time for us to attack it head-on," Warren said. "Look at the men on this stage. Collectively, they have lost 10 elections. The only people on this stage who have won every single election that they've been in are the women."

As the debate closed and candidates congratulated each other, Sanders and Warren appeared to exchange sharp words. They pointedly did not shake hands.

The tension comes as Sanders and Warren have seen their political fortunes flip. Warren, long one of the top contenders in Iowa, has stumbled in recent months as she struggled to say how she would pay for some of her plans. Sanders, who has slowly and methodically built a loyal base of support for five years, has surged into a front-running position.

"Joe and I listened to what Dick Cheney and George Bush and [Donald] Rumsfeld had to say. I thought they were lying. I didn't believe them for a moment," Sanders said. "Joe saw it differently."

Later, a top Sanders adviser said it was no accident that the Vermont Independent had clashed so often with Biden, who stood side by side at center stage.

"There's some overlapping base, voting base between Sen. Sanders and Vice President Biden, and I think we have been involved in an effort to highlight Joe Biden's record as it relates to working-class people in the country as a U.S. senator, and it's not favorable," said Jeff Weaver, Sanders's senior adviser.

But those stakes seemed to inspire a sort of prevent defense, as the candidates protected their share of the electorate instead of risking a last-minute slide by attacking a rival. The candidates onstage Tuesday spent most of the largely flat debate addressing the issue Iowa Democrats have said is most important to them: which of them is most capable of beating Trump in November's general election.

"We need a candidate who will excite all parts of the Democratic Party, bring everyone in and give everyone a Democrat to believe in," Warren said. Buttigieg repeatedly described his "different approach," a contrast with what he derisively called a "Washington mentality."

Biden said he had demonstrated the toughness necessary to beat Trump during months in which the president has promoted baseless conspiracy theories about Biden's son's business interests.

"I've been the object of his affection now more than anybody else on this stage," Biden joked.

Klobuchar, in need of a breakout moment as she struggles to reach the top tier, cast herself as a safe harbor capable of winning in territory that has been moving away from Democrats in recent years.

"If you are tired of the extremes in our politics and the noise and the nonsense, you have a home with me," Klobuchar said.