LAS VEGAS — Republican Donald Trump and Democrat Hillary Clinton clashed on abortion rights on Wednesday as they opened their third and last presidential debate with a substantive policy discussion on the Supreme Court and the top issues it faces.

In contrast to the fiery personal attacks of the first two debates, Clinton and Trump had a sharp but issues-based exchange on abortion, gun rights and immigration during the 90-minute showdown.

The candidates also battled sharply over the influence of Vladimir Putin, with Clinton calling Trump the Russian president’s puppet and Trump charging Putin had repeatedly outsmarted Clinton.

Clinton promised to appoint justices who would uphold a woman’s right to abortion laid out in the 1973 Roe v. Wade decision, while Trump promised to appoint what he called “pro-life” justices who would overturn the decision.

Under current law, Trump said, “You can take the baby and rip the baby out of the womb of the mother just prior to the birth of the baby.”

“Honestly, nobody has business doing what I just said, doing that as late as one or two or three or four days prior to birth,” Trump said.

Clinton said Trump’s “scare rhetoric is just terribly unfortunate.”

“This is one of the worst possible choices that any woman and her family has to make and I do not believe the government should be making it,” Clinton said.

Trump said he would appoint a Supreme Court justice who would protect American gun rights.

He has said in the past that Clinton wants to “essentially abolish” the Second Amendment of the U.S. Constitution guaranteeing a right to bear arms.

Clinton said she supports gun rights, but wants additional regulations on guns, citing examples of children being hurt or killed in gun accidents. “I see no conflict between saving people’s lives and defending the Second Amendment.”

Clinton said Trump had refused to condemn Putin and Russia for recent cyberattacks.

“He’d rather believe Vladimir Putin than the military and civilian intelligence officials that are sworn to protect us,” Clinton said.

U.S. intelligence agencies and the Department of Homeland Security have said the Russian leadership was responsible for recent cyberattacks on the Democratic National Committee and the leaking of stolen emails.

Trump rejected the idea that he was close with Putin, but suggested he would have a better relationship with Russia’s leader than Clinton.

“He said nice things about me,” Trump said. “He has no respect for her, he has no respect for our president and I’ll tell you what, we’re in very serious trouble.”

Clinton responded: “Well that’s because he’d rather have a puppet as president of the United States.”

“No, you’re the puppet,” Trump retorted. “Putin has outsmarted her and Obama every single step of the way,” he said in a reference to President Barack Obama.

Clinton also said Trump had been “cavalier” about nuclear weapons and should not be trusted with the nuclear codes.

Clinton and Trump walked straight to their podiums when they were introduced at the University of Nevada, Las Vegas, forgoing the traditional handshake as they did at the second debate last week in St. Louis, Missouri.

Trump refused to say that he would accept the outcome of the Nov. 8 presidential election, leaving open the possibility he would challenge the ultimate outcome.
“I will tell you at the time, I will keep you in suspense,” Trump said.

The New York businessman has raised concerns by claiming the election will be rigged against him. He has urged supporters to patrol polling places in inner cities to prevent voter fraud.

Clinton responded: “Let’s be clear about what he is saying and what that means: He is denigrating, he is talking down our democracy and I for one am appalled that someone who is the nominee for one of our two major parties would take that position.”

Trump accused Clinton’s campaign of orchestrating a series of accusations by women who said the businessman made unwanted sexual advances against them.

Trump said all of the stories were “totally false” and suggested Clinton was behind the charges. He called her campaign “sleazy.”

“I think they either want fame or her campaign did it, and I think it’s her campaign,” Trump said.

Clinton said the women came forward after Trump said in the last debate he had never made unwanted advances on women.

“Donald thinks belittling women makes him bigger. He goes after their dignity, their self-worth and I don’t think there is a woman anywhere who doesn’t know what that feels like,” Clinton said.

The two candidates clashed over accusations that Clinton as secretary of state from 2009 to 2013 did favors for high-dollar donors to her family’s Clinton Foundation. Asked about a potential conflict of interest, she said she acted “in furtherance of our country’s values and interests.”

She and Trump talked over each other, Clinton defending her ties to the foundation, saying “there is no evidence” of a conflict, while Trump said the foundation should return millions of dollars to countries such as Saudi Arabia and Qatar who treat gay people harshly.

“It’s a criminal enterprise,” Trump said.

Clinton said she would be happy to compare the Clinton Foundation to Trump’s charitable Trump Foundation, which among its activities was to buy “a 6-foot statue of Donald.”

Trump, 70, was seeking to reverse his fading momentum in an election that opinion polls show is tilting away from him.

Clinton, 68, leads in national polls and in most of the battleground states where the election will likely be decided. She has struggled to get past concerns about transparency raised over her use of a private email server for work communication while she was secretary of state.

Trump campaign manager Kellyanne Conway acknowledged that her candidate went into the debate as the underdog.

“It’s a comeback and he’s done it before several times in this campaign,” Conway said on Fox News, adding a gibe at Clinton: “Hillary Clinton just has not been able to put him away. What is her problem already?”

Trump has lashed out at what he calls a political and media system rigged against him, an apparent bid to discredit the process before the election takes place. Obama said on Tuesday that Trump needs to “stop whining” and make his case to voters.

Trump’s daughter Ivanka, who has advised the candidate, said she thought her father would “do the right thing” and accept the Nov. 8 result, no matter what it is. When asked if she thought the election was rigged, she said at a Fortune “Most Powerful Women Summit” that the media had been “vicious” about Trump.

Trump’s running mate, vice presidential nominee Mike Pence, has broken with Trump on the issue. Asked on Fox News if voter fraud would affect the outcome, he said, “I don’t think that’s the case, honestly.”

Both candidates invited guests who could be seen as provocative.

Trump asked Obama’s estranged half-brother Malik, who supports the Republican, as well as Pat Smith, the mother of one of four Americans killed in the 2012 attacks in Benghazi, Libya, who blames Clinton for her son’s death.

Clinton’s guests include Mark Cuban, the billionaire owner of the Dallas Mavericks basketball team and a frequent Trump antagonist.