• Sanders is officially an independent in the Senate, though he has been accepted as a member of the Senate Democratic leadership.

• Throughout his career, Sanders has maintained an outsider image by maintaining a foot in independent party politics.

• Sanders has signed a pledge to the Democratic National Committee to run and serve as a Democrat if elected president. The pledge is new for 2020, and it stems from questions in some Democratic circles about his party affiliation.

With Sen. Bernie Sanders jumping out to a delegate lead in the Democratic presidential primaries, some of his rivals have been attacking the Vermont senator for not being a "real" Democrat.

"The fact that someone lists themselves as an official independent, not even as a Democrat, except to run for the office of president, and then lists himself as a socialist — that doesn't fly," Biden said on CNN in the run-up to the South Carolina primary, which Biden ended up winning decisively.

In Florida, two Democrats filed a lawsuit in Leon County, seeking Sanders' disqualification from the state's primary ballot, citing his status in the Senate as an independent. The Florida Democratic Party sided with Sanders, calling the suit "ridiculous."

So how does Sanders qualify to run in the Democratic primary when he's an independent in the Senate?

The bottom line is that he's done everything the Democratic National Committee has asked him to do in order to prove his support for the party. But before we get to that, let's recap Sanders' long history near, but not in, the Democratic Party. (The Sanders campaign did not respond to an inquiry for this article.)

RELATED: What Bernie Sanders has said about the Democrats over the years

Sanders' partisan history

As we noted when he ran in 2016, Sanders was the nominee of the anti-capitalist, anti-war Liberty Union Party of Vermont in two Senate and two gubernatorial elections in Vermont between 1972 and 1976. He lost all four races and resigned from the party in 1977, calling it "sad and tragic," according to Greg Guma, author of The People's Republic: Vermont and the Sanders Revolution.

In 1981, Sanders made an independent bid for mayor of Burlington as a self-described socialist. He won by 10 votes over the city's Democratic mayor and two other independents, and went on to win three more terms.

Democrats and leftists disagree on where Sanders' political allegiances were during this decade.

Liberty Union Party co-founder Peter Diamondstone doesn't buy Sanders' claims to independence. He told the Daily Caller that Sanders "became a full-time Democrat" in 1984, when he campaigned for Democratic presidential candidate Walter Mondale.

Yet Sanders continued to clash with the party locally, and his "goal was to destroy Democrats," Maurice Mahoney, the head of Burlington's Democratic Party in the 1980s, told Politico. He also mounted independent challenges against Democrats, including Vermont's first female Democratic governor in 1984, and reiterated that he had no party affiliation.

"I am not now, nor have I ever been, a liberal Democrat," he said in a 1985 New England Monthly profile, according to Politico.

"Socialist is the political and economic philosophy I hold, not a party I run under," he explained in 1988, when he unsuccessfully ran for Congress.

Winning a U.S. House seat

After he won a seat in the House of Representatives in 1989, he continued to hold the Democratic Party at a rhetorical arm's length even as he moved closer to them.

Sanders lobbied for admission into the Democratic caucus for practical reasons (getting coveted committee assignments, mustering votes for bills), according to news reports from his first year in Congress. But party leaders wouldn't let him join as he refused to become a Democrat.

So in 1991, Sanders along with four liberal Democrats founded the Congressional Progressive Caucus, and he became its chairman. During his second year in office, Sanders continued to agitate and criticize Democrats, lumping them in with Republicans and calling both parties' tax proposals "grossly inadequate."

At some point, Sanders began to win the goodwill of Democratic leadership, despite refusing to join the party.

A month before he was elected to a third term in 1994, House Democrats blessed his bid for a leadership role on one of his committees. Sanders had no Democratic challenger that year, and a spokesperson for his Republican opponent called Sanders "an adjunct to the Democratic Party," according to the Washington Post.

The party backed Sanders' 1996 re-election bid over one of their own, Burlington lawyer and Democrat Jack Long. Sanders wouldn't have another Democratic opponent until 2004.

By 1997, Sanders was still not a member of the House Democratic Caucus or a Democrat. But he voted with the party more often than the average Democrat (95% of the time, compared with the average of 80%), and Democratic leadership gave Sanders a subcommittee chairmanship over a freshman Democrat.

When Sanders ran for the Senate a decade later in 2006, still as an independent, the party worked to stop Democratic candidates from running against him, and he was endorsed by numerous state and national Democrats.

In 2016, when he made his first run for president, some top Democrats revived questions about whether Sanders was truly a Democrat. But Sanders noted that he listed the Democratic Party as his party affiliation in his statement of candidacy, and he affirmed at a New Hampshire town hall, "Of course I am a Democrat."

Sanders has also noted that the Senate Democratic Caucus has named him a member of its leadership — director of outreach — even though he is not officially listed as a Democrat in the chamber.

Sanders in 2020

Partly to clarify some of the questions raised by Sanders' 2016 presidential primary run, the Democratic National Committee drew up new requirements for 2020 candidates.

The DNC mandated that every candidate running for president in 2020 "affirm, in writing, to the National Chairperson of the Democratic National Committee that they: A. are a member of the Democratic Party; B. will accept the Democratic nomination; and C. will run and serve as a member of the Democratic Party."

Sanders signed this affirmation document. (You can see it here.) He also filled out official paperwork with the Federal Election Commission stating that he was running for president as a Democrat. The DNC told PolitiFact that every other candidate who ran for the nomination signed it as well.

Sanders "is recognized as a candidate for the Democratic nomination because the national party acknowledges him as one of the candidates," said Josh Putnam, a political scientist who specializes in delegate selection rules. As a practical matter, Putnam said, the Democratic Party was in something of a box for 2020, since it had already allowed him to run in 2016. The party "certainly couldn't or wouldn't backtrack on that now," he said.

End of story? Not exactly.

Sanders has also filed a document with the Federal Election Commission to run for reelection to the Senate in 2024 — as an independent.

In a February 2019 CNN town hall, Sanders responded to a question about his party affiliation by saying that he "won the Democratic nomination in my state, but in Vermont, I have chosen to run as an independent because it goes way, way back."

Vermont’s rules

Sanders' ability to blur his party ties is aided by the rules of his home state of Vermont.

"Vermont is one of the states that has no registration by political party," said Eric Davis, a professor emeritus of political science at Middlebury College. "So, no one in Vermont, voters or candidates, is 'officially' an Independent, a Democrat or a Republican."

It's also the case for the U.S. political system overall.

"Most democratic nations' parties have actual members, in that you sign up, pay your dues, and attend meetings and events if you wish. We don’t," said Marjorie Hershey, an Indiana University political scientist.

Sanders has taken political advantage of his straddle between being an independent and working closely with Democrats, political scientists say.

"As a political matter, it adds to his 'authenticity' as a populist running against the establishment," said Wayne Steger, a DePaul University political scientist.

Indeed, Sanders has emphasized his outsider status at least as much, if not more than, his Democratic Party credentials during the primary contest. For instance, after his victory in the Nevada caucuses, Sanders tweeted, "I've got news for the Republican establishment. I've got news for the Democratic establishment. They can't stop us."

I've got news for the Republican establishment. I've got news for the Democratic establishment. They can't stop us. — Bernie Sanders (@BernieSanders) February 22, 2020

The tweet was liked more than 180,000 times.

Sanders "has long demonstrated a deep disdain for the organized Democratic Party and its leadership," said Emory University political scientist Alan Abramowitz. "This goes over well with his base, but it is a source of some concern and irritation among many Democratic party leaders, elected officials and activists."

Sanders' party straddle may be controversial in some circles, but it's not unprecedented historically, experts said.

For instance, in 1896, William Jennings Bryan was the Populist Party's presidential candidate at the same time he was the Democratic Party's nominee, Steger said. Bryan lost that election.