NEW YORK — President Obama responded Tuesday to controversial remarks by Republican Mitt Romney by suggesting that his opponent was “writing off a big chunk of the country” and was wrong to suggest that nearly half of Americans think of themselves as victims entitled to a handout from government.

In an interview on “The Late Show with David Letterman” taped Tuesday afternoon in New York and scheduled to air nationally later in the evening, Obama said:

“When I won in 2008, 47 percent of the American people voted for John McCain,” Obama said. “They didn’t vote for me and what I said on election night was: ‘Even though you didn’t vote for me, I hear your voices, and I’m going to work as hard as I can to be your president.’”

Obama said presidential candidates are always under the microscope and are going to make mistakes. Letterman reminded the president of his own gaffe in the 2008 campaign, when he spoke of conservatives who “cling to guns or religion.” But Obama noted that he immediately apologized for the statement — an apparent contrast to Romney’s defense of his comments, which Romney called “inelegant” but reflective of his views.

The statements in question came to light on Monday, when Mother Jones released videos from a private fundraiser in Florida in May in which Romney dismisses Obama’s supporters as “victims” who take no responsibility for their livelihoods and who think they are entitled to government handouts. He said that his job “is not to worry about those people. I’ll never convince them that they should take personal responsibility and care for their lives.”

On Tuesday afternoon, Mother Jones released the full video, including controversial remarks showing the Republican nominee saying that Palestinians have “no interest whatsoever” in reaching a peace agreement with Israel.

In the Letterman interview, Obama said traveling the country he never meets anyone ”who doesn’t believe in the American dream.”

“There are not a lot of people out there who think they’re victims,” he said. “There are not a lot of people who think they’re entitled to something.”

But, he added: “We’ve got some obligations to each other, and there’s nothing wrong with us giving each other a helping hand so that that single mom’s kid, even after all the work she’s done, can afford to go to college.”

Tuesday was Obama’s second appearance on the Letterman show since he became president. First lady Michelle Obama was a guest on the show earlier this month. The program was scheduled to air at 11:30 p.m. Tuesday.

The president was Letterman’s sole guest Tuesday, and he sat for a wide-ranging interview that included a few lighter moments as well as more serious ones. Letterman lingered on a number of serious topics, asking Obama to explain the nation’s budget crisis at length and to comment on the gridlock that much of the nation sees in Washington.

“There’s more than enough blame to spread around,” Obama said. “These problems have been around for a decade or more.”

Asked about the violence in Libya last week that led to the death of Ambassador Christopher Stevens, Obama said the administration’s top priorities now are to “refortify” security at American embassies abroad and to bring the murderers to justice. He criticized the offending anti-Muslim video that triggered the violence, but he said the video was not an excuse for violence.

“The message we have to send to the Muslim world is that we expect you to work with us, to keep our people safe, and as offensive as this video was — and obviously we denounced it, the United States government had nothing to do with it — that’s never an excuse for violence.”

On the lighter side, Letterman opened the interview by complimenting the president’s appearance and asking him how much he weighs. The president responded that he weighs about 180 pounds, which prompted Letterman to say he weighs the same but doesn’t look so good.

“You look good,” Obama replied.

“You haven’t seen me naked,” Letterman said.

Obama: “We’re going to keep it that way.”

Obama laughed at length when Letterman encouraged the president to say something to the empty chair next to him — a reference to Clint Eastwood’s speech at the Republican National Convention, at which he addressed an empty chair that was meant to symbolize Obama.

And for his top 10 list, Letterman named the top 10 questions the Secret Service asked his staff in preparation for the president’s visit, including: “Who’s gonna frisk Letterman’s hair piece?”

Romney also did a top 10 list in December 2011, according to his campaign.

Letterman also remarked on how grown-up Obama’s daughters, Sasha and Malia, looked at the Democratic National Convention in Charlotte this month.

“Does that kill you?” Letterman asked.

“It worries me, but they’re surrounded by men with guns,” Obama replied.

In addition to taping Letterman’s show, Obama was scheduled to attend two fundraisers in New York, one at the Waldorf Astoria hotel and another at 40/40, the swanky Manhattan club owned by hip-hop mogul Jay-Z. He and his wife, Beyonce, were scheduled to host the second event.

About 200 people attended the reception at the Waldorf Astoria, paying a minimum of $12,500 per family to do so, with a number of donors bringing their toddlers. Tickets to the Jay-Z/Beyoncé event cost $40,000, with about 100 expected to attend, including a couple who won a contest open to small donors.

Proceeds from Tuesday’s fundraisers will go to the Obama Victory Fund, a joint fundraising committee of Obama for America, the Democratic National Committee and several state Democratic parties.

The Obama campaign wasted no time early Tuesday taking advantage of the Romney video. By late Monday, campaign manager Jim Messina had put out a statement and other campaign officials predicted the video would figure prominently in campaign ads soon.

By early Tuesday afternoon, that prediction came true when the Obama campaign released a web video featuring interviews with Americans reacting to the piece.

“Wow,” one man said in the video.

“I actually felt stick to my stomach,” said a woman. Other comments included “I don’t like it” and “It shows that he’s out of touch if he thinks half the country is feeling like victims.”

Staff writer Philip Rucker contributed to this report.