At CNN's town hall on Jan. 25, the Democratic presidential candidates took to the stage for the last time before the Iowa caucuses. Here's what the three candidates said to try to win over voters. (Jenny Starrs/The Washington Post)

The two leading contenders for the Democratic presidential nomination on Monday offered contrasting views of what matters most in the Oval Office — with former secretary of state Hillary Clinton citing her experience, and Vermont Sen. Bernie Sanders saying that his judgment has proven superior to hers.

Both, meanwhile, portrayed themselves as the right person to bring about change — although in very different styles.

They made their cases at a town hall-style forum here, held one week before the first votes of the primary season are set to be cast in the Iowa caucuses.

Sanders, who went first, was aggressive in attacking Clinton, while she did not directly attack him when it was her turn to take the stage.

Sanders argued that Clinton, despite having been secretary of state for four years, was not better prepared for the presidency than he is.

Democratic presidential candidate Sen. Bernie Sanders participates in a town hall forum hosted by CNN at Drake University in Des Moines, Iowa, Jan. 25, 2016. (Justin Sullivan / Pool/EPA)

“Experience is important, but judgment is also important,” Sanders said. He noted that he had voted against the Iraq invasion — “the most significant vote and issue regarding foreign policy that we have seen in this country in modern history” — while she had supported it.

He also ticked off a set of other questions where he had been on the opposite side of Clinton, or made up his mind more quickly — fighting against the deregulation of Wall Street that occurred during the presidency of her husband, Bill Clinton; opposing the Keystone XL pipeline, while she was indecisive, and opposing a number of trade agreements, where she vacillated.

Most importantly, he said, he could be counted upon to buck the established order.

“It just seems to me that the crises that we face as a country today ... inequality, poverty in America, an obscene and unfair campaign finance system,” he said, “these problems are so serious that we have got to go beyond establishment politics and establishment economics. In my view we need a political revolution where millions of people stand up and say you know what, that great government of ours belongs to all of us, not just the few.”

When Clinton’s turn came, a young voter who said he planned to attend his first caucus, asked her why people his age did not seem as enthused about her as they are about Sanders.

“I’ve been on the front lines of change and progress since I was your age,” she said. “I’ve taken on the status quo time and time again.” Clinton cited her efforts to overhaul the health-care system during her husband’s presidency, despite intense opposition from Republicans, which ultimately killed her plan.

More broadly, Clinton portrayed herself as better prepared for the presidency than Sanders, saying “you’ve got to do all aspects of the job,” including foreign policy.

Hillary Clinton, former Secretary of State and 2016 Democratic presidential candidate, speaks during a Democratic Town Hall event in Des Moines, Iowa, Jan. 25, 2016. (Justin Sullivan/Bloomberg)

She cited as an example her role as secretary of state during the long process that eventually led to a nuclear deal with Iran at a time when many friendly countries thought it would be easier to bomb them.

“I spent a lot of time explaining to our friends why that was not a good idea,” Clinton said.

A week before the caucuses, the race is in flux. Clinton’s lead in the Iowa polls, generally holding well into the double digits as recently as November, has evaporated. That is raising fears in her camp that this contest could be a replay of 2008, when the front-running Clinton was beaten in Iowa by a first-term senator named Barack Obama, setting him on a course to win the Democratic nomination.

Sanders has tapped into a deep well of dissatisfaction within the Democratic base. The question now is whether he can motivate non-traditional caucus-goers to show up, as Obama did eight years ago.

As the race has tightened, the two have grown increasingly aggressive in their attacks on each other.

The former secretary of state has sought to put the Vermont senator on his heels on a range of issues, suggesting he is an unreliable ally on gun control, health care and reproductive rights. She has said his proposals are unrealistic.

Clinton has also argued that she is the only candidate prepared to do the entire job of being president — a not-so-subtle dig at a competitor whose campaign has focused largely on economic issues. She has suggested that Sanders is not pushing realistic policy ideas, citing as a prime example his plan for a single-payer, Medicare-for-all health plan.

Sanders, meanwhile, has been taking aim at Clinton more directly. In a Washington Post interview over the weekend, he said Clinton was running a “desperate” campaign incapable of generating the kind of excitement his has. Sanders sharply questioned Clinton’s association with David Brock, who runs a pro-Clinton super PAC, repeatedly calling him a “hit man,” and he said he expects the Clinton campaign to throw “the kitchen sink” at him to try to blunt his momentum.

At the town hall, Sanders did not deny that his proposals, including a government-financed health-care system, would require a massive tax increase.

“I start off with the premise that in the last 30 years, although my Republican friends don’t like the term, there’s been a massive redistribution of wealth in this country. It’s gone from working families, trillions of dollars, to the top one tenth of 1 percent,” he said.

“So, yes, what this campaign is about is to say to profitable corporations who, in some years don’t pay a nickel in taxes, to the wealthiest people in this country who sometimes have an effective tax rate lower than truck drivers or nurses, yes, you are going to start paying your fair share of taxes,” he added.

And while Americans would pay more in taxes under a government-run health system, known as single-payer, that would be more than offset by the savings they would enjoy by not having to pay for private health insurance, Sanders said.

Clinton said she thinks she received “fair criticism” in a recent Des Moines Register editorial endorsing her candidacy that expressed disappointment in how long it took her to apologize for the controversy surrounding her use of a private email server while secretary of state.

Clinton objected, however, to CNN host Chris Cuomo’s characterization of the episode as an error in judgment.

“I’m not willing to say it was an error in judgment because nothing I did was wrong,” she said.

However, she was gentler on Sanders during the town hall than she has been in recent weeks.

Clinton was shown an extended clip of a minute-long Sanders ad that features images of his enthusiastic supporters at rallies while the Simon and Garfunkel classic “America” plays in the background.

Asked about the ad, Clinton said: “I think that’s great. I think that’s fabulous. I love it.”

She said she appreciated what Sanders has brought to the race but quickly pivoted to say “I believe I’m the better person to be the Democratic nominee and to be the commander in chief of the country.”

Monday night represented perhaps the last chance for the third Democratic candidate, former Maryland governor Martin O’Malley, to be seen as relevant before a national audience. Despite spending more time in Iowa than either Clinton or Sanders, he has remained mired in the single digits in polling.

Under the complicated rules of the Iowa caucuses, in most of the 1,681 precincts, a candidate must get 15 percent support to be considered viable. Otherwise, his supporters must align with another candidate or sit out the rest of the process.

Cuomo asked O’Malley which way his supporters might go. O’Malley demurred, saying he would send this message to his supporters: “Hold strong at your caucus because America’s looking for a new leader.”

O’Malley also sought to set himself apart from his two competitors, saying he is “the one candidate among the three of us with 15 years of executive experience.”

O’Malley, who served as eight years as Maryland governor and seven years as mayor of Baltimore, touted his state’s passage of same-sex marriage in 2012 as example of his ability to bring people together and get things done.

Abby Phillip contributed to this report.