But his newly resolute attitude is also the cumulative result of months of anger at the national Democratic Party over a debate schedule that his campaign said favored Mrs. Clinton; a fund-raising arrangement between the party and the Clinton campaign; the appointment of fierce Clinton partisans as leaders of important convention committees; and the party’s rebuke of Mr. Sanders on Tuesday for not clearly condemning a melee at the Nevada Democratic convention on Saturday.

While Mr. Sanders says he does not want Mr. Trump to win in November, his advisers and allies say he is willing to do some harm to Mrs. Clinton in the shorter term if it means he can capture a majority of the 475 pledged delegates at stake in California and arrive at the Philadelphia convention with maximum political power.

Tad Devine, a senior adviser to Mr. Sanders, said the campaign did not think its attacks would help Mr. Trump in the long run, but added that the senator’s team was “not thinking about” the possibility that they could help derail Mrs. Clinton from becoming the first woman elected president.

“The only thing that matters is what happens between now and June 14,” Mr. Devine said, referring to the final Democratic primary, in the District of Columbia. “We have to put the blinders on and focus on the best case to make in the upcoming states. If we do that, we can be in a strong position to make the best closing argument before the convention. If not, everyone will know in mid-June, and we’ll have to take a hard look at where things stand.”

The prospect of a drawn-out Democratic fight is deeply troubling to party leaders who are eager for Mrs. Clinton and House and Senate candidates to turn to attacking Mr. Trump without being diverted by Democratic strife. Mr. Sanders has won nearly 10 million votes, compared to Mrs. Clinton’s 13 million, and Democratic leaders say she needs time to begin courting the young voters, liberals and other Sanders supporters who view her as an ally of corporate and big-money interests.