He voted against the Defense of Marriage Act (“President Clinton signed it, everyone was for it”), the deregulation of Wall Street (“Check the record! Do it. Go to YouTube, look up ‘Bernie Sanders, Alan Greenspan’ ”), the war in Iraq, the Patriot Act and welfare reform. On all the issues, he suggested, he has moved the party.

But Mr. Sanders has been more of an outlier than a leader throughout his congressional career. When he was a congressman, elected as an independent, and House Democrats decided to allow him to caucus with them to increase their depleted numbers, Representative Bill Richardson of New Mexico called him “a homeless waif” and Representative Barney Frank of Massachusetts bemoaned his “holier-than-thou attitude.”

Since his election to the Senate in 2006, Mr. Sanders has become more reliable in his alignment with the Democrats, though he was a determined, and effective, opponent to Mr. Obama’s effort to reach a grand bargain on the budget in 2011 because of the possibility of cutting Social Security.

Tom Coburn, the former Republican senator from Oklahoma, who was also a part of those budget negotiations as a member of the bipartisan Gang of Six, said that Mr. Sanders had a “my way or the highway” approach to legislating. He recalled the time he held up one of Mr. Sanders’s bills in the Senate.

“He said, ‘If you’re going to hold my bill, I’m not going to negotiate with you.’ And I said: ‘That’s fine, I’m holding your bill then. If you want to adjust your bill and meet some of our concerns, then I’ll be happy to work with you,’ ” Mr. Coburn said. “But he never once did want to do that.”

When Senator Mark Warner of Virginia, a moderate Democratic member of the Gang of Six working for the budget deal, was asked if Mr. Sanders understood the give-and-take of legislating, he smiled and said, “You always know where he stands,” before disappearing into an elevator.

Democrats often left their weekly caucus lunch fuming over Mr. Sanders’s latest immovable stance.

“I know there are other people who are kind of resentful of that, who sit down with Republicans and make a whole lot of concessions before the debate begins,” Mr. Sanders said. “That’s not my style.”