Republican presidential candidate Donald Trump and his Democratic rival, Hillary Clinton, on Wednesday night faced off for the third and final debate before the November presidential election.

The debate took place at the University of Nevada in Las Vegas and moderated by Fox News anchor Chris Wallace.

The two candidates were asked about the Supreme Court and where they would want to see the court take the country.

“The Supreme Court needs to be on the side of the American people, stand up on behalf of women’s rights. The Supreme Court should represent all of us,” said Clinton, who called on the Senate to confirm President Barack Obama’s candidate.

Trump, replying to the same question, said, “It’s so imperative that we have the right justices. Recently, Justice Ginsburg made some inappropriate statements towards me and she was forced to apologize and apologize she did – but these statements should not have been made.”

“The justices that I will appoint will be pro-life, they’ll protect the Second Amendment, they’ll interpret the Constitution the way the founders wanted it to be interpreted. I believe that’s very very important,” he added.

The two were specifically asked about gun control, and Clinton said she “understands and respects the tradition of gun ownership” but “there can be and must be reasonable” control.

“We have 33,000 people a year who die from guns. We need comprehensive background checks,” close the online loophole and gun show loophole. These measures would not conflict with the amendment, added Clinton.

Trump said, “I am a very strong supporter of the Second Amendment and I’m very proud to have the support of the NRA. We’re going to appoint justices that will feel very strongly about the Second Amendment and will not do damage to it.”

On the issue of illegal immigration, Trump stressed, “We need strong borders. We have no country if we have no border. Hillary wants to give amnesty.”

“I want to build the wall. We need the wall,” he continued. “We have some bad bad people in this country who need to go out. We’ll secure the border and once we do that we’ll figure out what to do with the rest.”

Clinton called for secure borders along with reforms on immigration. “This used to be a bipartisan issue,” she said.

Trump stressed, “We are going to destroy radical Islamic terrorism in this country. [Clinton] won’t even say the word. Neither will our president. We are in serious trouble because there are countries with nuclear warheads. [Russian President Vladimir] Putin has no respect for this person (referring to Clinton –ed.)”

Putin, continued Trump, “has outsmarted [Clinton] on every issue. Just look at the Middle East. They’ve taken over. She’s been outsmarted and outplayed worse than anybody I’ve ever seen.”

Asked about taxes, the Republican candidate said Clinton’s tax plan “is a disaster. We will have massive tax cuts under Clinton.”

Clinton argued that Trump “would advocate for the largest tax cuts we’ve ever seen. I will not add a penny to the debt.”

The question of fitness to be president came up as well, with Trump being asked about his lewd comments on women and subsequent claims of women that he harassed them.

“Why would they make up these stories?” asked Wallace.

“Those stories have been largely debunked,” replied Trump. “I have a feeling those people came thanks to the Clinton campaign.

“Nobody has more respect for women than I do. Nobody,” he stressed. “[These allegations] are fictionalized, but what isn’t fictionalized is the 30,000 emails she destroyed after getting a subpoena from the FBI. That’s what you should be talking about. Not fiction.”

Clinton fired back, “Every time Donald is pushed on something which is uncomfortable, he immediately denies responsibility. We know what he’s done to women, but he’s also gone after a disabled reporter. He attacked Mr. and Mrs. Khan because of their religion. He went after Senator McCain – a prisoner of war. He went after a judge, born in Indiana, and said he couldn’t judge the case about Trump University because his parents are from Mexico. It’s a pattern and that is not what America is.”

Trump was asked whether he would “absolutely commit” to accept the results of the election, after claiming the election was “rigged”.

“I’ll look at it at the time,” he replied. “She should not be allowed to run. She’s guilty of a very serious crime, and just in that respect I say the election is rigged. She should not have been allowed to run for president based on the things she did.”

Clinton countered by saying that every time Trump doesn’t get his way he claims the system is rigged.

“It’s funny, but it’s also pretty troubling. This is not the way democracy works,” she added.

The issue of the Islamic State (ISIS) jihadist group in Syria and Iraq was discussed as well, with Trump saying that Clinton as Secretary of State was responsible for ISIS taking over the Iraqi city of Mosul. He added that Iran is the main beneficiary of the conflict because it will emerge victorious in Mosul.

Clinton, for her part, called for a no-fly zone for Syria and expressed support for a diplomatic solution to the civil war there.