CARSON CITY, Nev. — U.S. Senate candidates Rep. Joe Heck and Catherine Cortez Masto faced off in a feisty debate Friday night, jabbing each other over their parties’ presidential nominees and other issues as they continue a tight race for the seat held by retiring Sen. Harry Reid.

The wide-ranging debate held at a North Las Vegas high school and broadcast Friday was the only scheduled TV matchup between the candidates, whose race is considered a tossup and could decide which party controls the U.S. Senate. The exchange was at times held up by raucous cheers from supporters in the audience.

Democrat Cortez Masto went on the offensive against Heck’s prior support of Trump, saying her Republican opponent’s decision last week to revoke his endorsement after lewd Trump comments came to light was a political maneuver designed to save himself and “you don’t get credit for that.”

“Let’s call this what it is — Congressman Heck is worried about his political career,” said Cortez Masto, a former two-term Nevada attorney general whose campaign has focused much of its efforts on linking Heck and Trump. “Donald Trump’s ship is sinking, and Congressman Heck is scurrying off it.”

Heck, who had voiced firm on his support of his party’s nominee even though he never made a public appearance with Trump, argued his reversal was “extremely personal” because his wife experienced domestic abuse in a past relationship and he’s personally treated victims.

“As an emergency room doctor, I’ve taken care of far too many women that have been victims of domestic violence or sexual assault, and I have great empathy for anyone who has ever had to experience such a tragedy,” he said.

He added that he was “incredulous” that his opponent backed Hillary Clinton even when FBI Director James Comey said she lied about maintaining a personal email server. Cortez Masto said the email issue was a mistake but Clinton is fit for the presidency.

“Hillary Clinton has recognized and taken responsibility for those emails, recognized her mistake, and she wouldn’t do it again,” Cortez Masto said. “There’s no doubt in my mind that she has the temperament, the experience and the ability to lead this country as commander-in-chief.”

On immigration, Cortez Masto pounded Heck for not doing more to pass immigration reform bills during his three terms in the House. Heck’s mixed voting record on a program that waives deportation for immigrants brought to the country illegally has become a central issue in campaign ads, especially in Spanish.

“It is about ensuring that we put them on a tough but fair path to citizenship,” said Cortez Masto, who could be the first Latina in the U.S. Senate and often talks about her grandfather emigrating from Mexico.

Heck said immigrants who are in the country illegally and have a criminal past should be deported, but said those without one “should be given a path to some kind of legal status.” He said immigration issues should be handled separately, not in all-or-nothing bills.

“We need to work toward comprehensive immigration reform,” he said. “I would not support a 2,000-page bill. I support addressing each piece of immigration reform individually.”

The debate got personal at times, veering into questions about offensive social media postings about race from Heck’s 19-year-old son and also into how each candidate met their spouse.

Candidates also got a chance to try cornering their opponents with a question of their own. Heck asked Cortez Masto a foreign policy question about how the U.S. should handle Chinese aggression in the South China Sea, while Cortez Masto asked a loaded question about how Heck felt cashing his congressional paycheck when federal employees couldn’t during a government shutdown.

Nevadans can cast their ballots when early voting begins on Oct. 22. The state’s open Senate seat is considered the only one Republicans could reasonably flip to their side in a year they’re playing defense in other states, and outside groups have spent tens of millions of dollars trying to influence the outcome.