At a raucous rally in Newtown, Pa., Republican presidential candidate Donald Trump urged supporters to vote. It was Trump's third rally in one day. (The Washington Post)

As he took the stage here in this mountain town Friday afternoon, Donald Trump was as subdued as the modest crowd that turned out to see him. He complained about the usual things — the dishonest media, his “corrupt” rival Hillary Clinton — but his voice was hoarse and his heart didn’t seem in it.

He also promised to do all that he could to win, but he explained why he might lose.

“What a waste of time if we don’t pull this off,” Trump said. “You know, these guys have said: ‘It doesn’t matter if you win or lose. There’s never been a movement like this in the history of this country.’ I say, it matters to me if we win or lose. So I’ll have over $100 million of my own money in this campaign.”

“So, if I lose,” Trump continued as the crowd remained unusually quiet, “if I lose, I will consider this —”

Trump didn’t finish his sentence, but he didn’t really need to. After weeks of controversy and declining poll numbers, Trump and his campaign have settled into a dark funk. Even as he vows to prevail in the race, the GOP nominee’s mood has soured with less than three weeks to go until Election Day.

Watch Republican presidential nominee Donald Trump make jokes at the annual Alfred E. Smith Memorial Foundation Dinner in New York on Oct. 20. (The Washington Post)

His final debate performance this week was a bust, with him snarling that Clinton was “such a nasty woman” and gritting his teeth as he angrily ripped pages off a notepad when it was over. He is under fire from all quarters for refusing to say he will honor the election results if he loses, while 10 women have now come forward accusing him of groping or kissing them without consent. The capper to Trump’s bad stretch came Thursday night, when a ballroom full of New York City’s glitterati booed him as he gave remarks attacking Clinton at a charity roast.

The gloomy mood has extended to his signature rallies, which Trump used to find fun. During the primaries, he would bound onto rally stages bursting with energy and a sense of excitement that intensified as the crowds chanted his name and cheered his every word. He would regularly schedule news conferences, call into news shows and chat with reporters, eager to spar with them. He would say politically incorrect things and then watch his polling numbers soar. He used to be the winner.

But no more. In recent days, Trump has tried to explain away his slide in the polls as a conspiracy carried out by the media, Democrats and Republicans. If he loses, it will be because he was cheated, Trump has repeatedly told his supporters, urging them to go to polling places in neighborhoods other than their own and “watch.”

Trump’s supporters have concocted elaborate explanations for why he might lose, often involving massive voter fraud conducted by Democrats who will bus undocumented immigrants and people posing as people who have died to battleground states to vote illegally. There are also fears that election results in some states will be tampered with, and Trump’s backers have cheered his promise to challenge the election results if he doesn’t win.

“Since we can’t check to see if you voted in three states, you will. If you want to vote in three states, you will,” said Larry Lewis, 67, a former electrician who lives in Hendersonville, N.C.. He said he doesn't know anyone who has committed voter fraud but has gotten up to speed on the issue thanks to talk radio. “I mean, that is human nature. I have ultimate faith in human nature.”

Campaigning Friday in Cleveland, Clinton again criticized Trump for refusing to say he will honor the election results and joked about her time onstage debating him. “I have now spent 41/2 hours onstage with Donald, proving once again I have the stamina to be president,” she said.

Watch Democratic presidential nominee Hillary Clinton make jokes at the annual Alfred E. Smith Memorial Foundation Dinner in New York on Oct. 20. (The Washington Post)

After the debate Wednesday night, Trump flew to Ohio for a Thursday rally. He abruptly walked out of two local television interviews before taking the stage in front of a smaller-than-usual crowd. After it was over, he was back at the Columbus airport, slowly plodding up the steps to his personal jet. He was alone, holding a black umbrella as a light rain fell.

Hours later, Trump sat with his wife at the Alfred E. Smith Memorial Foundation Dinner to participate in the long-standing tradition of political candidates roasting each other. The dinner’s chairman, Alfred E. Smith IV, set the tone for the evening as he lashed Trump in a series of cutting jokes.

Trump went first, and his opening lines landed with such heavy bitterness that it prompted scattered, uncomfortable laughter.

“A special hello to all of you in this room who have known and loved me for many, many years. It’s true,” Trump said as he took command of the lavish dais, wearing a white tie and a black jacket that he kept tugging at.

“The politicians,” he continued. “They’ve had me to their homes, they’ve introduced me to their children. I’ve become their best friends in many instances. They’ve asked for my endorsement, and they always wanted my money, and even called me really a dear, dear friend, but then suddenly decided when I ran for president as a Republican, that I’ve always been a no-good, rotten, disgusting scoundrel. And they totally forgot about me.”

Over the next 15 minutes, Trump joked about the size of his hands and the size of his rival’s rally crowds, then compared himself to Jesus. He said the debate the night before had been called “the most vicious debate in the history of politics,” prompting him to reflect, “Are we supposed to be proud of that?”

He joked about prosecuting Clinton if he gets elected president, accused the media of working for her and brought up the FBI’s investigation into Clinton’s use of a private email server while secretary of state.

“Hillary is so corrupt, she got kicked off the Watergate Commission,” Trump said, citing a false Internet rumor as the crowd turned on him and started to boo, something that simply doesn’t happen at lavish charity dinners at the Waldorf Astoria hotel. The face of one the guests sitting on the stage behind him was struck with horror.

“Hillary believes that it’s vital to deceive the people by having one public policy and a totally different policy in private,” Trump said, as the booing intensified. Trump would go on to accuse Clinton of “pretending not to hate Catholics” and mock the Clinton Foundation’s work in Haiti.

At one point, he wondered aloud whether the crowd was booing him or Clinton, to which someone in the crowd answered: “You!”

As Clinton took her turn, Trump sat at a table decorated with pale roses and white orchids with his arms tightly folded.

“Donald looks at the Statue of Liberty and sees a four, maybe a five if she loses the torch and tablet and changes her hair,” Clinton said, as the crowd laughed and former New York mayor Rudolph W. Giuliani mouthed, “What?”

Trump, his arms folded, cocked his head to the side and smirked as his wife looked elegantly pained.

A few minutes later, Clinton poked Trump for his praise of Russian President Vladi­mir Putin: “Maybe you saw Donald dismantle his prompter the other day, and I get that. They’re hard to keep up with, and I’m sure it’s even harder when you’re translating from the original Russian.”

Trump smiled and rocked in his seat, his face turning slightly red.

Clinton recognized former New York mayor Michael R. Bloomberg, saying it was a shame he didn’t speak, because “I’m curious to hear what a billionaire has to say,” referring to disputes about Trump’s actual net worth.

And she gave a shout-out to Trump’s campaign manager, Kellyanne Conway, saying: “She’s working day and night for Donald, and because she’s a contractor, he’s probably not even going to pay her.” Conway, who has become subtly critical of her boss, quoted Clinton in a tweet and wrote, “A shout out from @HillaryClinton at #AlSmithDinner.”

As Clinton finished speaking, she received a standing ovation from many in the crowd. Trump clapped, then briefly stood, then sat down again, as if unsure what to do. Lip-readers caught him telling her that she did a good job.

As the dinner ended, Trump shook hands with some of the others on the stage, while a line of people wanting to talk with Clinton grew. After a few minutes, Trump and his wife made their way toward the exit.

Before ducking out, Trump flashed the crowd a thumbs up.

Abby Phillip in Cleveland contributed to this report.