Yet the conclusion of the campaign was largely to Mr. Jones’s benefit.

Mr. Jones raised $10.2 million in just over a month and a half, and third-party groups augmented his candidacy, helping him finance an extensive voter turnout effort after he had dominated the state’s airwaves for weeks.

He raced across Alabama with a handful of out-of-state surrogates and one local celebrity, the basketball star Charles Barkley, in the election’s last days, focusing his attention on cities, college towns and heavily black communities.

Mr. Moore, instead of facing questions about accusations of sexual abuse, largely vanished from the campaign in the last week. He returned to Alabama for a rally in the rural, southeast corner of the state on Monday with Stephen K. Bannon, Mr. Trump’s former chief strategist.

But the most memorable comments from the event did not come from Mr. Moore. Rather, they emerged from Mr. Bannon, who mocked the MSNBC host Joe Scarborough, a University of Alabama graduate, for not attending a more prestigious school; Mr. Moore’s wife, Kayla, who angrily denied charges the couple was anti-Semitic by noting “one of our attorneys is a Jew;” and an Army friend of the candidate, who recalled the two of them being uneasy walking into a Vietnam brothel to find “pretty girls” whom Mr. Moore found too young.