"Of course I am a Democrat and running for the Democratic nomination," Sanders told a New Hampshire town hall on Wednesday night. 
CNN host Anderson Cooper, the moderator of the town hall, had asked Sanders about a tweet from Sen. Barbara BoxerBarbara Levy BoxerCalifornia AG Becerra included in Bloomberg 50 list Climate debate comes full circle Fox's Ingraham transitioning longtime radio show to podcast MORE (D-Calif.), who attacked Sanders as an occasional Democrat.
Responding to Sanders's comment that Democratic front-runner Hillary ClintonHillary Diane Rodham ClintonGillibrand announces exploratory committee to run for president on Colbert Former PepsiCo CEO being considered for World Bank chief post: report Live coverage: Trump AG pick grilled on Mueller probe at confirmation hearing MORE was a progressive on "some days," Boxer, a Clinton ally, tweeted, "Hillary is a progressive EVERY day. Bernie is a Democrat 'some days.'" 
After quoting Boxer, Cooper asked Sanders, "In your heart, are you a Democrat?"
"Sure," Sanders replied, citing his long tenure in the House and Senate Democratic caucuses, albeit as an Independent.
He went on to say that Clinton cannot claim to be both a moderate and a progressive.
"You can't go and say you're a moderate on one day and be a progressive on the other day.
"Some of my best friends are moderates. I love moderates. But you can't be a moderate and a progressive. They are different."
Sanders tried to play down expectations that he would secure a strong victory in New Hampshire, given he is currently ahead by almost 20 percentage points in the latest RealClearPolitics average.
"Of course we’re an underdog," Sanders said. "We are taking on the most powerful political organization in the country and that’s the Clinton organization."