WASHINGTON — Seeking to avoid the bitter feelings that marred the 2016 Democratic convention, Joe Biden’s campaign is angling to allow Bernie Sanders to keep some of the delegates he would otherwise forfeit by dropping out of the presidential race.

Under a strict application of party rules, Sanders should lose about a third of the delegates he’s won in primaries and caucuses as the process moves ahead and states select the actual people who will attend the Democratic National Convention. The rules say those delegates should be Biden supporters, as he is the only candidate still actively seeking the party’s nomination.

Quiet talks between the two campaigns center on allowing Sanders to keep some of his delegates, essentially a goodwill gesture from a presumptive nominee seeking to court Sanders’ progressive supporters and unite the party. It is not yet settled how many.

“We feel strongly that it is in the best interest of the party to ensure that the Sanders campaign receives statewide delegates to reflect the work that they have done to contribute to the movement that will beat Donald Trump this fall,” said a Biden official, who wasn’t authorized to discuss private negotiations publicly and spoke on condition of anonymity. “We are in discussion with them now on how to best accomplish that.”

Sanders’ campaign declined to comment on the talks. “Nothing to add from us,” said Sanders spokesman Mike Casca.

In some ways, the delegate count is a moot point. While he has yet to formally win the 1,991 delegates needed to claim the Democratic nomination on the first ballot at the party convention, Biden is the Democrat’s presumptive nominee. All of his rivals — including Sanders — have endorsed him after ending their own campaigns.

But with the nomination essentially decided, who has how many delegates takes on a new meaning. In 2016, rowdy Sanders supporters booed some speakers and any mention of nominee Hillary Clinton at the party’s Philadelphia convention. The disruptions were so embarrassing to the party that Sanders pleaded with his supporters not to stage protests on the floor.

By claiming the delegates that ought to belong to him under party rules, Biden could cut down on the number of Sanders’ backers — some of whom have been slow to embrace the former vice president — who could stage a replay of that divide. Instead, he’s decided to try to attract Sanders’ supporters rather than silence them.

For his part, Sanders wants as many delegates as possible to help shape the party’s platform and get Biden and the Democratic Party to embrace his democratic socialist agenda.

It is not unusual for rival presidential campaigns to negotiate over delegates once the nominating contest is over. In 2008, Clinton and Barack Obama fought over how to divvy up delegates from disputed primaries in Michigan and Florida. Clinton won both states. However, the states had violated party rules by holding their primaries too early in the calendar and were therefore to be stripped of all their delegates.

Clinton’s supporters were furious over the outcome, which saw Obama getting delegates from both states even though he wasn’t even on the ballot in Michigan. But at the national convention that summer, it was Clinton who made the motion during the roll call vote to nominate Obama by acclimation.

Democratic candidates win convention delegates based on their share of the vote in the party’s primaries and caucuses. To date, Biden leads Sanders 1,293 to 937.

Nearly two-thirds of delegates are won based on results in individual congressional districts and they stay with the candidates all the way to the convention.

It’s the other third of delegates — won based on statewide results — that are at issue. To keep these delegates, candidates must still be running for president when the people who will serve as convention delegates are selected, usually at state party conventions, according to the party’s delegate selection rules.

Those rules say Biden should get 346 delegates won by Sanders, Elizabeth Warren, Mike Bloomberg, Pete Buttigieg and Amy Klobuchar. Sanders’ delegate count would fall to 628.

Most states have yet to select the people who will attend the convention as delegates, and The Associated Press has not yet updated its delegate count to reflect the shift in delegates from Biden to Sanders that should take place under party rules. But some states, including Colorado, have updated their delegate counts based on those rules.

Sanders won the Colorado primary on March 3 and took the most delegates from the state. But after he quit the race, the state party announced that Biden — the only candidate left — will end up with the most delegates from Colorado.

Biden will take 34 delegates from Colorado to the Milwaukee convention, including all those awarded statewide. Sanders, meanwhile, will get 16, with Bloomberg getting nine and Warren eight.

Additional reporting by Will Weissert