Mrs. Clinton may have been helped by the campaign’s shift to foreign policy, where Mr. Sanders is seen as weaker, after the Nov. 13 terrorist attack in Paris. Mrs. Clinton said in a speech in New York on Thursday that the Republicans’ approach to fighting the Islamic State, compared with her own, amounted to “a choice between fear and resolve.” She derided as un-American the Republicans who said they would either bar Syrian refugees from resettling in the United States or allow only Christian refugees.

“There are forces no candidate can control, and they can be detrimental,” Representative James E. Clyburn, Democrat of South Carolina, said when asked about the newfound focus on defeating the Islamic State. “I believe in this case third-party forces are working in her favor.”

Among Democrats, Mrs. Clinton holds a 25 percentage point lead over Mr. Sanders nationally, according to a Bloomberg Politics poll released on Friday. She had a nine-point advantage in the same poll in September, when it included Vice President Joseph R. Biden Jr., who later said he would not seek the nomination.

“By turning up the heat on Republicans, going after Trump, that’s all part of the essence of saying, ‘I am the leader of the Democratic Party,’ ” said Robert Shrum, a strategist for Democratic presidential candidates including John Kerry and Al Gore.

The primary is by no means determined. Polls in Iowa, in particular, tend to undercount Mr. Sanders’s young supporters who do not have landline phones, his aides say. And he continues to lead in some polls in New Hampshire, which was supposed to be a stronghold for Mrs. Clinton.

Even as Mrs. Clinton focuses firmly on the Republicans, her campaign is increasing its indirect, if aggressive, moves to squeeze Mr. Sanders.

She has secured the backing of major labor unions, including most recently the Service Employees International Union, which has two million members. Her campaign has emphasized Mrs. Clinton’s commitment to gun control, an issue that Mr. Sanders, as a senator from a hunting state, has been less vehement about, and she delivered a major foreign policy speech on Thursday in New York, the same day Mr. Sanders delivered a speech about Democratic socialism in Washington. (“Ah, the attempted bigfoot,” Mr. Weaver said of the timing of the two speeches. The Clinton campaign announced its speech a day earlier than the Sanders team.)