LAS VEGAS Just two days before Nevada Democrats caucus, Hillary Clinton didn't hold back in her criticism of Bernie Sanders at a town hall where both of them spoke.

Clinton questioned the authenticity of Sanders' identity as a Democrat when asked if she should be held accountable for the presidency of her husband, Bill Clinton. And she disparaged Sanders not only for his criticism of her husband, but also of President Obama.

"Maybe it's that Senator Sanders wasn't really a Democrat until he decided to run for president. He doesn't know what the last two Democratic presidents did," she remarked, as the audience responded by booing her. "Well, it's true. It's true. You know it's true," Clinton said, shrugging her shoulders.

Get Breaking News Delivered to Your Inbox

In the town hall, hosted by MSNBC, Sanders said he thought Bill Clinton "did a pretty good job as president" but he disagreed with the work he did on NAFTA, deregulation of Wall Street and welfare reform.

Earlier in the day, Sanders had spoken to reporters on his campaign plane and called some of Bill Clinton's achievements "disastrous." But at the town hall, Sanders tried to recast those comments as the kind of disagreement that is a fundamental tenet of democracy.

"If anybody thinks that a member of the United States Senate or the United States House has to agree with somebody in his own party who is president, well -- you know -- all of the time, that is not my understanding of democracy," Sanders said.

Yet, on Thursday night Sanders stood squarely by Mr. Obama when he was asked about Islamaphobia. After saying he would address it "bluntly and directly," Sanders talked about the attacks on the president by those who claim he was not born in the U.S.

"I am appalled," Sanders said, by the idea that some might try to "de-legitimatize" Mr. Obama by suggesting he was not born in America.

"No one asked me whether I'm a citizen or not. My father came from Poland. Gee, what's the difference? Maybe the color of our skin."

From the audience of about 350 people in Nevada, many of the questions were asked in Spanish, on the topic of immigration. Clinton committed to producing immigration reform legislation within her first 100 days in office.

"I will do everything that I can to pass immigration reform and a path toward citizenship for those who today are undocumented," even if it is not a perfect piece of legislation, she vowed.

That is "unacceptable, and should not be happening," Sanders said in response to a woman who told him about her undocumented husband, who was barred from the U.S. for 10 years, after she tried unsuccessfully to bring him out of the shadows.

Clinton, who was not on stage for that exchange, made sure to specifically address that audience member when she hit the stage.

"I want to tell you, I will end the three and 10-year bar provision so that you do not have to face that ever again," Clinton said. She explained that her plan would be to move this effort forward on two paths: a separate piece of legislation and inclusion in comprehensive immigration reform.