Suggesting that he might defy long-standing tradition and extend the rancor of a divisive election year, Donald Trump on Wednesday night refused to say that he would accept the results of the Nov. 8 presidential election, drawing a rebuke from Hillary Clinton.

"I will tell you at the time," the Republican candidate told moderator Chris Wallace when asked in the final presidential debate whether he would accept the election's results. "I will keep you in suspense."

"That's horrifying," his Democratic rival said, accusing Trump of denigrating American democracy in one of the most striking moments of the debate in Las Vegas.

"We've been around for 240 years, we've had free and fair elections, we've accepted the outcomes when we may not have liked them, and that is what must be expected of anyone standing on a debate stage during a general election," Clinton said.

Trump's response drew immediate reprimands and dominated the postdebate discussion.

"Mr. Trump is doing the party and country a disservice" by claiming the election is rigged, Sen. Lindsey Graham (R., S.C.), a primary opponent, said in a statement. "If he loses, it will not be because the system is 'rigged' but because he failed as a candidate."

As his poll numbers have plunged, Trump has for weeks claimed that the election is fixed, citing biased media and, without evidence, widespread voter fraud - raising fears of an ugly, and perhaps violent, dispute after Election Day.

He has particularly singled out Philadelphia with his claims of cheating.

Republicans and Democrats have forcibly denounced his comments, but on a national stage, Trump stood by them.

"Our elections may not always be completely perfect, but they are legitimate, they have integrity, and everyone needs to respect the outcome," Sen. Pat Toomey (R., Pa.) said in his own debate Monday night. "That's going to be necessary to pull us all together on Nov. 9."

Philadelphia's city commissioners have also firmly rejected any suggestion that cheating could change the outcome of the election.

"The real threat to the integrity of elections in Philadelphia isn't voter fraud, though it does rarely occur," said Republican Al Schmidt, vice chairman of the commissioners. "The real threat to the integrity of elections is irresponsible accusations that undermine confidence in the electoral process."

Trump's comments came late in a 90-minute debate at the University of Nevada, Las Vegas in which each candidate attacked the rationales behind their rival's campaigns.

Trump sharply assailed Clinton's years of experience as ineffective, while Clinton attacked the radical change Trump has espoused as a danger to the very fabric of the country.

Trump, needing to reverse a weeks-long slide in polls, appeared to make some early inroads with one of his most focused attacks on Clinton's record, battling her on issues and questioning why she had not done more in her decades in public life to address many of the problems she now pledges to fix.

"The one thing you have over me is experience, but it's bad experience," Trump said. "The problem is, you talk, but you don't get anything done."

When she pressed him on his avoiding federal income taxes for years, Trump questioned why, as a senator, she didn't fix the system: "If you don't like what I did, you should have changed the law."

Clinton said she was proud of her long record, contrasting her public service with his time as a celebrity.

Clinton, meanwhile, said Trump has presented a dark, divisive vision that threatens the character of the country.

"You are the most dangerous person to run for president in modern history of America," Clinton said, quoting Sen. Bernie Sanders. "I think he's right."

The clashes came late in a debate that began on its most substantive note yet - with the candidates, both subdued, elaborating on clear differences on abortion, gun laws, and immigration.

But the battle turned harder-edged as the night went on. At one point Trump interrupted Clinton, spitting out, "Such a nasty woman."

The debate arrived with Trump needing a massive change of momentum. His campaign had spiraled downward since the first debate, Sept. 26, seeming to hit a low point with a string of recent accusations of sexual assault.

The latest polls show him trailing in key states and facing the possibility of an Electoral College rout.

Trump dismissed the sexual-assault allegations at the debate, saying the women must have been put forward by the Clinton campaign.

"It was lies, and it was fiction," Trump said. "Nobody has more respect for women than I do."

Clinton, in turn, faced questions about the activities of the Clinton Foundation, the charity her family founded, and its ties to foreign donors - including some countries, Trump pointed out, with poor records on women's rights.

"It's a criminal enterprise," Trump said.

Clinton said the foundation had addressed the HIV and AIDS crisis across the globe, while Trump's charity had purchased a six-foot portrait of the developer.

Clinton began the night in a strong position, seemingly needing to just ride out the debate without providing her rival with the kind of signature moment that could change the course of the race.

And indeed, the most memorable moment came from Trump.

The debate's setting, Las Vegas, seemed fit for an election defined by a raucous, carnivallike and at times grotesque atmosphere.

A vast spread of empty parking lots and shipping containers stacked three high cordoned off the debate site at the UNLV basketball arena. The "public expression area" for protesters was not visible to reporters and camera crews there to cover the main event.

As a result, none of the color of Las Vegas intruded, aside from a Jeep SUV parked outside a security checkpoint with an anti-Trump slogan painted on its back window.

@JonathanTamari

Politics writer Thomas Fitzgerald contributed to this article.