Donald Trump and Hillary Clinton squared off at the University of Nevada in Las Vegas for the last time before Americans go to the polls on November 8.
Here are the key moments from their final head-to-head presidential debate.
Mr Trump suggesting he may not accept the result of the election
The Republican candidate appeared to leave the door open to challenge the result by refusing to say if he would accept the outcome.
He has previously suggested the poll was being rigged.
Despite being repeatedly asked if he would accept the result, Mr Trump said: “I will tell you at the time. I’ll keep you in suspense.”
Mrs Clinton described his remarks as “horrifying”.
She accused him of attacking UK democracy, adding: “Every time Donald thinks things are not going in his direction, he claims whatever it is is rigged against him.
“There was even a time when he didn’t get an Emmy for his TV programme three years in a row and he started tweeting the Emmys were rigged against him.”
Mrs Clinton called Mr Trump a “puppet” of Russian president Vladimir Putin.
The Democratic candidate called on Mr Trump to condemn Mr Putin for Russia’s alleged interference in the race for the White House, saying there had been cyber attacks from the highest level of the Kremlin, resulting in the hacking of emails during the election campaign.
Mr Trump said: “I don’t know Putin. He said nice things about me. If we got along well, that would be good.
“He has no respect for her. He has no respect for our president.
“We’re in very serious trouble. We have a country with tremendous numbers of nuclear warheads ... 1,800 nuclear warheads and she’s playing chicken.”
Mrs Clinton responded: “That’s because he’d rather have a puppet as president of the United States”.
Mr Trump replied: “No, you’re the puppet.”
Mr Trump said he would strengthen immigration controls and build a wall at the Mexico border because the US needs to find a way to stop “some bad hombres”.
He said the country needs “strong borders” to help stop illegal immigrants and drugs which are “pouring” into the country.
Mr Trump said: “We have to have strong borders. We have to keep the drugs out of our country. Right now we are getting the drugs, they are getting the cash. We cannot give amnesty. I want to build a wall. We need the wall.
“We stop the drugs. We shore up the border. One of my first acts will be to get all of the drug lords - we have some bad, bad people in this country that have to go out. We have some bad hombres here and we are going to get ‘em out.”
Nasty woman jibes
Among the bitter flashpoints were the claims that Mr Trump had sexually assaulted a number of women and also his tax affairs.
Mrs Clinton was talking about her plans to raise taxes on the wealthy and referred to Mr Trump’s tax affairs. She said: “My social security payroll contribution will go up, as will Donald’s, assuming he can’t figure out how to get out of it.”
Mr Trump hit back: “Such a nasty woman.”
He also accused her campaign team of creating the “totally false” allegations about how he treats women.
“I didn’t even apologise to my wife who is sitting right here because I didn’t even do anything,” he added.
“These women ... I think they either want fame or her campaign did it. And I think it’s her campaign.”
Mrs Clinton said: “Donald thinks belittling women makes him bigger. He goes after their dignity and self-worth.”