WASHINGTON ― Pennsylvania Democrats would like to dig themselves out of a huge deficit in the state’s House of Representatives, where Republicans hold 121 out of 203 seats. That could be slightly more difficult now that their candidate for a special election in a heavily Democratic district has just been kicked off the ballot for allegedly not living in the district.

A Commonwealth Court judge ruled Thursday that Frederick Ramirez, the Democratic candidate for the 197th House District seat, must be removed from the ballot for the March 21 election. The decision, if upheld on appeal, would leave Democrats with no listed candidate. The 197th District encompasses heavily Latino neighborhoods in Philadelphia where 85 percent of voters are Democrats and just 5 percent are Republicans.

The only other candidate on the ballot is Republican Lucinda Little.

Judge Anne Covey held that Ramirez did not meet the requirements for maintaining a domicile in the district. The court was presented with evidence of low water and energy usage for the apartment in which the candidate claimed to be living. Ramirez acknowledged that he spent multiple days of the week with his daughter at a suburban house and with his girlfriend at her home outside the district.

“I believe the court got it wrong,” Ramirez’s lawyer, Adam Bonin, told The Huffington Post.

“I can’t believe this,” said Ramirez, according to the Philadelphia Inquirer. “This is a political decision. This is not a legal decision.”

The case was initiated by the local Republican Party and joined by two Democrats, as necessary under state law.

Covey’s decision creates a real possibility that Democrats could lose a seat they should otherwise win easily. It comes amid a string of bad news for Pennsylvania Democrats. Not only did they lose ground in the state legislature in 2016 and fail to defeat U.S. Sen. Pat Toomey (R-Pa.), but a number of their elected officials have recently faced corruption convictions or allegations.

Leslie Acosta, the previous occupant of the 197th District seat, was forced to step down after pleading guilty to felony embezzlement in 2016, hence the upcoming special election. In June, U.S. Rep. Chaka Fattah of Philadelphia was found guilty of corruption charges stemming from his 2007 bid to become mayor of Philadelphia. He resigned and was later sentenced to 10 years in prison. Other Philadelphia Democrats, including a city councilman and the former district attorney, face federal probes.

The Democratic setback in Pennsylvania also occurs just as a new generation of activists are flooding party offices across the country looking to turn their anger at President Donald Trump and the national Republican Party into political action at the local level.

There is still a chance that the party could hold onto the 197th seat. “We are carefully studying all of our options, but time is of the essence now,” Bonin said.

Ramirez could appeal the decision to the state Supreme Court. Democrats could also ask the courts to allow them to replace Ramirez on the ballot with a different candidate. Since the election is in less than a month, there may not be enough time to pursue the first option and then, if they lose, the second option. The party may have to choose one or the other.

In a last-ditch effort, the party could mount a write-in campaign for a different candidate. While politicians around the country have won under such circumstances, they have usually benefited from years of high name recognition. There may not be a high-profile candidate waiting in the wings for the 197th.

Democrats aren’t the only ones to find themselves in a bad position in this special election. Green Party candidate Cheri Honkala isn’t on the ballot either, because her party didn’t file nomination papers on time.

CORRECTION: An earlier version of this article misidentified Republican candidate Lucinda Little as Linda Kerns. This article also stated that the Green Party had a representative in a state legislature. That legislator was elected as a member of the Green Party but later switched to the Democratic Party.