Photo

DES MOINES — After weeks of tightening polls and strategic shifts, Hillary Clinton on Sunday ended her Iowa campaign on an upbeat, optimistic note at her biggest rally yet, flanked by her husband and daughter.

“I am really over the moon that my granddaughter is back at the hotel,” Mrs. Clinton told a crowd here of more than 2,600 people packed into the gymnasium at Abraham Lincoln High School.

Before she took the stage, Mrs. Clinton was introduced by former President Bill Clinton, saying of his wife, “Of all the people I’ve ever worked with, she is the single best at making everything she touched better.”

Mrs. Clinton’s speech did not veer far from her usual script, but she delivered it with new enthusiasm, pouring 10 months of campaigning in Iowa into a single speech focused on rallying caucusgoers to her pitch as the Democratic candidate best suited to defeat the Republicans in the fall.

“I want to keep making the case until the caucuses are over because I feel so strongly we can’t afford to make a mistake,” Mrs. Clinton said, implying that nominating her opponent Senator Bernie Sanders, a self-avowed democratic socialist, would be a mistake.

But Mr. Sanders was not the focus of Mrs. Clinton’s night. Instead, she took aim at the Republican Party, which she said caused the 2008 financial crisis and that overwhelmingly favors the wealthy and the well connected over the working class.

She praised Mr. Clinton’s economic record, but, she said, after he left office, “back came the Republicans, back came trickle-down economics, back came cutting taxes on the wealthy and corporations.”

“America,” she added in one of her favorite statistics, “is four times as likely to have a recession with a Republican in the White House.”

Mrs. Clinton then went into detail about her policy plans, from closing corporate tax loopholes, investing in infrastructure, placing additional regulations on Wall Street and vowing to not raise taxes on the middle class.

“The only way they can be successful is if the American people develop a case of collective amnesia and they don’t remember we’ve been down this road before,” Mrs. Clinton said. “It doesn’t end well.”