The one million dollars-a-day voter sweepstakes that Elon Musk’s political action committee is hosting in swing states can continue through the day of presidential election, a Pennsylvania judge has ruled.

Common Pleas Court Judge Angelo Foglietta — ruling after Mr Musk’s lawyers said the winners are not chosen by chance — did not immediately give a reason for the ruling.

Philadelphia District Attorney Larry Krasner had called the sweepstakes a scam that violates state election law and asked that it be shut down.

Philadelphia District Attorney Larry Krasner (Matt Rourke/AP)

The winners of the sweepstakes did not win by chance but are instead paid spokespeople for the group, Mr Musk’s lawyers said in court.

Musk lawyer Chris Gober said the final two recipients before Tuesday’s presidential election will be in Arizona on Monday and Michigan on Tuesday.

“The one million dollars recipients are not chosen by chance,” Mr Gober said on Monday.

“We know exactly who will be announced as the recipient today and tomorrow.”

Chris Young, the director of America PAC, testified that the recipients are vetted ahead of time, to “feel out their personality, (and) make sure they were someone whose values aligned” with the group.

America PAC lawyer Chris Gober (Matt Rourke/AP)

The disclosures prompted a lawyer for Mr Krasner to call the effort a “scam” that is “designed to actually influence a national election”.

Mr Musk’s lawyers, in closing arguments, called it “core political speech” given that participants sign a petition endorsing the US Constitution.

They said Mr Krasner’s legal bid to shut down the sweepstakes under Pennsylvania law was moot because there would be no more Pennsylvania winners before the programme ends.

Mr Krasner believes the giveaways violates state election law and contradict what Mr Musk promised when he announced them during an appearance with Republican presidential nominee Donald Trump’s campaign in Harrisburg, Pennsylvania, on October 19: “We’re going to be awarding a million dollars randomly to people who have signed the petition every day from now until the election.”

Mr Young also acknowledged that the PAC made the recipients sign nondisclosure agreements.

“They couldn’t really reveal the truth about how they got the money, right?” asked Krasner lawyer John Summers.

“Sounds right,” Mr Young said.

In an October 20 social media post shown in court, Mr Musk said anyone signing the petition had “a daily chance of winning one million dollars!”

Mr Summers grilled him on Mr Musk’s use of both the words “chance” and “randomly”, prompting Mr Young, who also serves as the PAC’s treasurer, to concede the latter was not “the word I would have selected.”

Mr Young said the winners knew they would be called on stage but not specifically that they would win the money.

Mr Musk did not attend the hearing. He has committed more than 70 million dollars to the super PAC to help Mr Trump and other Republicans win in November.

“This was all a political marketing masquerading as a lottery,” Mr Krasner testified on Monday morning. “That’s what it is. A grift.”