HARRISBURG, Pa. — President Donald Trump’s campaign followed through on a threat to sue Philadelphia, filing papers in court Thursday night over city officials preventing campaign representatives from watching people registering to vote or filling out mail ballots in new satellite election offices.

The lawsuit comes amid Trump baselessly claiming he can only lose the crucial battleground state of Pennsylvania if Democrats cheat and, as he did in 2016′s campaign, suggesting that the Democratic bastion of Philadelphia needs to be watched closely for fraud.

The 14-page lawsuit, filed in Philadelphia, revolves around the question of what rights there are for campaign representatives to watch people in election offices where they can register to vote, apply for mail ballots, fill them out, and turn them in.

“Bad things are happening in Philadelphia,” the campaign’s lawsuit said. “While transparency and accountability are hallmarks of election integrity, the actions of Philadelphia election officials to date have undermined election integrity by shrouding the casting of ballots in secrecy.”

The campaign is asking to be able to assign representatives to observe inside satellite election offices that Philadelphia began opening Tuesday around the city to help collect what is expected to be an avalanche of mail ballots in the Nov. 3 presidential election.

But there is no right under Pennsylvania law, even for a certified poll watcher, to watch people do things like register to vote or fill out a mail ballot.

Those rights are limited to certified campaign representatives to observe voting at traditional polling places on Election Day, or the opening of absentee and mail ballots in an election office. The Trump campaign has no poll watchers approved to work in Philadelphia at the moment.

Officials with the city commissioners, who run elections, did not immediately respond to requests for comment Thursday night. The campaign originally threatened to sue Tuesday night.

Polls show Democratic nominee Joe Biden holding a consistent, sizable, but not insurmountable lead against Trump in Pennsylvania.

Philadelphia on Tuesday opened the first seven of what is expected to be 17 satellite election offices, part of a new election law enacted last year that greatly expanded access to mail voting.

Trump campaign employees promptly showed up, insisting they be allowed to go in and observe the activity inside. However, city election officials — including a Republican city commissioner — prevented them, although they offered the campaign a tour of the facilities to let them see how they operate.

The president referred to that confrontation in Tuesday night’s debate with Biden, saying “bad things happen in Philadelphia.”

» READ MORE: ‘Bad things happen in Philadelphia,’ Trump says at debate, renewing false claim about poll watchers

The fight could widen. A number of counties, including the state’s most heavily populated counties, are opening satellite election offices and putting out drop boxes for voters to drop off mail ballots.

Philadelphia is home to one in five registered Democratic voters in Pennsylvania, and its turnout is closely watched in presidential elections.

In 2016, Trump won Pennsylvania by about 44,000 votes, or less than 1 percentage point. But he lost Philadelphia to Democrat Hillary Clinton by 67 percentage points, or about 475,000 votes, a gap that was slightly smaller than the historic margins produced for Barack Obama.

Trump’s campaign and other Republican groups have filed a number of lawsuits over election rules in Pennsylvania, seeking to expand poll watching, prohibit the use of drop boxes, and put other limits on mail ballots.