Photo

IOWA CITY, Iowa — Hillary Clinton campaigned with confidence in Bernie Sanders country on Thursday night, taking a couple of gentle jabs at her political rival during a rally with the singer Demi Lovato at the University of Iowa in this liberal hotbed.

The crowd of 1,600 included Sanders supporters who, like some others, came chiefly to hear Ms. Lovato perform. But Mrs. Clinton received loud cheers as well as she took the stage after Ms. Lovato and promised to “work as hard as I know how to take it to the Republicans and win the election.”

“I am proud of the progress we have made under President Obama, and I don’t want anyone sending us back,” Mrs. Clinton said, a seeming reference not only to Republicans but also to Mr. Sanders, who she has been attacking for proposing a single-payer health care system to replace Mr. Obama’s Affordable Care Act.

She also pledged to challenge “big special interests” — a popular line that Mr. Sanders uses as well — and take on “the gun lobby,” a stand she sees as a dividing line with the Vermont senator. Over the years Mr. Sanders has opposed some gun control legislation championed by many Democrats, including Mrs. Clinton.

Mrs. Clinton and Mr. Sanders are in a close race to win the Feb. 1 Iowa caucuses, with Mr. Sanders drawing 51 percent of the vote to Mrs. Clinton’s 43 percent in a new CNN/ORC poll released on Thursday. Mrs. Clinton had appeared to have an edge in several recent polls. Sanders advisers say they expect a huge Sanders vote in college towns like this one, given his strong support among students and young people.

Alli Placek, a 20-year-old health science major, said she was undecided but was leaning toward Mrs. Clinton because of her position on protecting women’s health, but it was the musical act that really got her out on Thursday night. “I was interested in Demi, but also interested in Hillary,” she said.

Tyler Holan, an 18-year-old sophomore, said he was supporting Donald J. Trump, but then he heard that Ms. Lovato was opening for Mrs. Clinton. “Demi is cool. She’s got my vote,” he said.

Nate Weger, a 20-year-old sophomore majoring in mechanical engineering, said he had seen both Democrats and was supporting Mr. Sanders. “Hillary seems to be kind of holding back,” he said. “Bernie seems a lot more honest when he talks.”

But, he added of Thursday night’s rally, “It was easy to come and Demi is here.”