Sen. Bernie Sanders (I-Vt.) speaks at a committee hearing on Capitol Hill last year. (AP/Cliff Owen)

When socialism comes to America, it will be wrapped in the flag and carrying a concealed firearm -- without a permit.

Bernie Sanders, an avowed democratic socialist, is challenging Hillary Rodham Clinton for the Democratic Party's presidential nomination next year. In many ways, his policies are what you'd expect from a liberal lawmaker who has said he's running "to take on billionaire class which controls our economy and increasingly controls the political life of this country."

When it comes to guns, though, the socialist is a moderate who has voted against gun-control advocates on several major bills during his time in Congress. That record may offer a hint of how the senator has managed to appeal to more moderate and conservative voters despite his hardcore liberal agenda.

[Sanders takes on 'billionaire class' in 2016 bid]

Hunting is a way of life in Vermont, and so are guns. Anyone can carry a concealed weapon there without a permit. Other Democrats from the state, such as Sen. Patrick Leahy and former governor Howard Dean, have also sought the middle ground on guns. Sanders's overall stance on gun rights isn't too surprising, given that he's represented Vermont as an independent in Congress for 24 years, first in the House and now in the Senate.

Some say that Sanders first won his seat in the House because Peter Smith, the Republican incumbent he defeated, supported a ban on assault weapons. "There was absolutely no doubt in that '90 vote that the NRA got [Sanders] elected, and he owed them," Chris Graff, a former Vermont bureau chief for the Associated Press, told Paul Heintz of the Vermont paper Seven Days in 2012.

Whether or not constituents chose Sanders because they hoped he would better protect their right to bear arms, the senator did not take any contributions from the National Rifle Association or other gun-rights groups that year. He hasn't since then, either, according to the Center for Responsive Politics and the Brady Campaign to Prevent Gun Violence.

Sanders would later vote against the 1993 Brady Bill, which required background checks for gun purchases.

In 2005, he voted to shield manufacturers from lawsuits brought by victims of gun violence. Consumers injured by dangerous products regularly bring similar lawsuits against other kinds of manufacturers. The firearms industry, along with the NRA and other gun-rights groups, argued that manufacturers shouldn't be held responsible for the actions of violent criminals with guns. Congress agreed, preventing victims from suing firearms makers.

Sanders has also voted against forcing states to respect concealed-carry permits issued by other states.

[These states are poised to allow people to carry hidden guns around without a permit]

Yet while he has been a supporter of gun rights, he has also taken plenty of criticism from Second Amendment groups for his positions in favor of other gun-control measures. He's consistently supported a ban on assault weapons. After the massacre at an elementary school in Newtown, Conn., in 2012, Sanders reversed his position on the Brady Bill the next year and voted to expand background checks. He didn't seem to fully embrace the new legislation, however. "If you passed the strongest gun-control legislation tomorrow, I don't think it will have a profound effect," he said. (The bill failed due to a Republican filibuster, joined by several pro-gun Democrats.)

In a recent response to written questions, Sanders's campaign said that the candidate had learned to shoot a rifle as a Boy Scout, but that he doesn't own any guns. While the responses emphasized the senator's vote in 2013, Sanders did not endorse new gun-control measures.

"There is no single or simple solution to this crisis," Sanders said in the statement. "In my view, Congress must consider a comprehensive approach which includes a serious discussion about guns, the need for greatly expanded mental health services and ending gratuitous violence [in] the media."

As a candidate for the Democratic presidential nomination, Sanders will likely adopt a similar strategy on guns. He has told reporters he will put social and cultural issues at the bottom of the agenda and focus on economic populism, which he hopes will unite liberals with more moderate voters, like Vermont's gun owners.

But expanding Sanders's appeal beyond the party's liberal base will be difficult, said Jim Manley, a Democratic strategist who calls himself "as liberal as they come."

"It’s going to be a real challenge for him," Manley said of Sanders's strategy. "As much as I admire him, I'm not so sure how well some of his views are going to play in Main Street America."

In any case, defeating Clinton will be nearly impossible. Still, if there is any kind of socialist who does have a chance of becoming president of the United States, that candidate might just be a Second Amendment socialist like Sanders.

Read more:

Your online guide to Bernie Sanders

In the hunt to be the 2016 GOP pick, top contenders agree on 1 thing: Guns

In states, a legislative rush to nullify federal gun laws