Sean Parnell, a key Republican politician and a candidate for the United States Senate from Pennsylvania, suspended his campaign for office on Monday after losing a legal battle linked to the custody of his three children. A US court determined that allegations of abuse against Parnell’s wife may be true.

Parnell had also been endorsed for the Senate seat by former United States President Donald Trump.

In a statement, Parnell said he was devastated by the judge’s decision, and planned to ask the judge to reconsider, but that he cannot continue his campaign.

The high-stakes campaign in the battleground state could help determine control of the United States Senate in next year’s election.

The decision by a judge in Butler County came two weeks after Parnell took the stand to deny allegations by his estranged wife that he had hurt her and the children.

The judge, James Arner, wrote in an order Monday that Parnell’s estranged wife, Laurie Snell, will have sole legal custody of the school-age children, as well as primary physical custody. Parnell will have physical custody on three weekends per month, Arner wrote.

Also Read: US West Coast becomes Democrat stronghold as GOP lacks presence

Snell was “the more credible witness,” Arner summed up in his 16-page opinion, saying she could remember and describe details in a convincing manner.

Pennsylvania’s Senate seat is opening up with the retirement of two-term Republican Senator Pat Toomey, and both Republicans and Democrats have a big field of candidates in the politically divided state.

Parnell’s withdrawal comes as many in the state Republican Party remain undecided about their field, which includes conservative commentator Kathy Barnette, real estate investor Jeff Bartos and Carla Sands, Trump’s ambassador to Denmark.

Parnell’s withdrawal represents a major blow to Trump, who had enthusiastically endorsed Parnell in September with the encouragement of his eldest son.

Trump spokesperson Taylor Budowich said Trump and Parnell spoke before Parnell’s announcement and that Parnell informed Trump of his intention to suspend his campaign, given the decision.

He said on Twitter that the Pennsylvania Senate race “remains a top priority” for the former president and that “rallying our movement behind the best America 1st candidate remains critical.”

Also Read: Pennsylvania sees rise in breakthrough COVID-19 cases

Parnell’s candidacy was a constant presence in the custody case, with the judge noting in his opinion that Parnell argued that Snell “is motivated to embarrass him in public and damage his political career,” while Snell argued that Parnell “is motivated to preserve a public image and his political career.”

Parnell, a decorated former Army Ranger who led a platoon in Afghanistan, penned a memoir of his service, which became a New York Times bestseller. He also has written four action novels, and emerged as a regular guest on Fox News programs before running for Congress last year and landing a coveted speaking slot at the Republican National Convention.

Trump’s endorsement came in early September, as Parnell was an in-demand guest on cable TV and conservative podcasts to discuss the Taliban’s seizing control of Afghanistan ahead of the withdrawal of American forces.

Even amid headlines about the custody case, Trump had backed up his support for Parnell by scheduling a fundraiser with Donald Trump Jr. on January 25 at Trump’s Mar-a-Lago Club in Palm Beach, Florida.

(With AP inputs)