DELAWARE, Ohio — Donald Trump said Thursday he would accept the results of the presidential election “if I win,” but he doubled down on his threat to legally challenge the results if he loses.

“America is a constitutional republic with a system of laws. These laws are triggered in the case of fraud or in the event of a recount where it is needed. Of course, I would accept a clear election result, but I would also reserve my right to contest or file a legal challenge in the case of a questionable result. Right?” Trump said at a Thursday afternoon rally at the Delaware County fairgrounds in this town that’s just north of Columbus.

Trump opened his rally by making a “major announcement” and, at first, it sounded as if he might soften the stance he took during the final presidential debate on Wednesday night in Las Vegas, when he refused to say that he would accept the results of the election — a stance that even his staff members have declined to back.

“Ladies and gentlemen, I want to make a major announcement today: I would like to promise and pledge to all of my voters and supporters, and to all of the people of the United States, that I will totally accept the results of this great and historic presidential election — if I win,” Trump said, as the crowd cheered.

Trump said that he will follow all laws and traditions but that he would not give up his right to legally challenge the results if he believes that voter fraud swayed the results. He suggested that it was unfair for the debate moderator to ask him to commit to accepting the results of the election.

“That was sort of an unprecedented question,” Trump said. “If Al Gore or George Bush had agreed three weeks before the election to concede the results and waive their right to a legal challenge or a recount, then there would be no Supreme Court case and no Gore v. Bush,” Trump said. He added, “In effect, I’m being asked to waive centuries of legal precedent designed to protect the voters.”

Speaking later at the Al Smith dinner in New York City on Thursday night, a dinner that benefits Catholic charity, Trump took the opportunity to unleash a torrent of very-not-light-hearted jokes about Clinton. They included Clinton hating Catholics, Clinton being corrupt and the Clinton Foundation’s alleged misdeeds during its relief efforts in Haiti.

A sampling:

“Last night, I called Hilary a nasty woman, but this stuff is all relative after listening to Hillary rattle on and on and one, I don’t think so badly of Rosie O’Donnell anymore.”

“Hillary is so corrupt, she got kicked off the Watergate Commission. How corrupt do you have to be to get kicked off the Watergate Commission?”

“We’ve learned so much from WikiLeaks. For instance, Hillary believes that it’s vital to deceive the people by having one public policy and a totally different policy in private ... For example, here she is tonight, in public, pretending not to hate Catholics.”

“Everyone knows of course, Hillary’s belief that ‘It takes a village,” which only makes sense — after all, in places like Haiti, where she’s taken a number of them.”

By the end, Trump was getting booed regularly.

Clinton also veered into personal digs, making one joke in which she said the Statue of Liberty, for most Americans, represents a symbol of hope for immigrants, The Associated Press reported.

“Donald looks at the Statue of Liberty and sees a ‘4,’” Clinton joked. “Maybe a ‘5’ if she loses the torch and tablet and changes her hair.”

Trump and Clinton sat one seat apart for the evening, with New York’s Cardinal Timothy Dolan acting as the only buffer. And when they entered and took their seats, they did not greet each other or make eye contact, though they did shake hands at the conclusion of the roast.

As Trump has fallen in the polls, he has said that the electoral system is rigged against him and that rampant voter fraud could rob him of votes, even though documented cases of such fraud are rare. Trump said Thursday undocumented immigrants are illegally voting in elections, even though only U.S. citizens are allowed to register to vote, and that Democrats are voting on behalf of people who have died, even though most jurisdictions regularly update their voter rolls.

“This is having nothing to do with me but having to do with the future of our country,” Trump said. “We have to have fairness.”

Trump accused Hillary Clinton’s campaign of doing whatever it takes to get her elected — measures that he said could involve voter fraud. He mentioned reports that Clinton received some of the questions ahead of a debate during the primaries and said that she should resign from the race for cheating. He also referenced reports that Democratic operatives with no direct connection to the Clinton campaign hired people to violently disrupt Trump’s rallies.

“This criminal behavior that violates centuries of tradition of peaceful democratic elections. A campaign like Clinton’s that will incite violence is truly a campaign that will do anything to win,” Trump said, going on to call Clinton “a candidate who is truly capable of anything, including voter fraud.”

In accusing Clinton of cheating at previous debates, Trump pointed to an email leaked by WikiLeaks from the spring in which interim Democratic National Committee Chair Donna Brazile seemed to suggest that he had insight into a question that would come up at a primary forum against Vermont Sen. Bernie Sanders, Clinton’s Democratic primary rival. Brazile has denied that CNN provided her any questions in advance. She has refused to verify the authenticity of the email.

Trump said: “But I ask you, why shouldn’t Hillary Clinton resign from the race? She was given these questions, studied these questions, got the perfect answer for these questions, and never said that she did something that was totally wrong and inappropriate.”

He said Thursday that Brazile should resign her post.

“It was just learned that Hillary Clinton was given the exact questions to a previous debate, word for word, by Donna Brazile, who is now under tremendous pressure to resign from the DNC, as she should be,” he said. “She should resign. How could a woman do that? That is cheating at the highest level.”

Trump said that he doesn’t expect to have to challenge the results of the election because he expects to win, even though he is trailing far behind Clinton.

“Bottom line,” Trump said, “we’re going to win. We’re going to win. We’re going to win so big. We’re going to win so big.”