Prosecutors in Philadelphia have sued to stop Elon Musk and his political group America PAC from awarding $1m (£770,092m) to voters in swing states, accusing the billionaire of "running an illegal lottery".
"America PAC and Musk must be stopped, immediately, before the upcoming Presidential Election on November 5, " Philadelphia District Attorney Lawrence Krasner said in the lawsuit.
The lawsuit comes days after the US justice department warned Musk’s PAC that its $1 million giveaway might violate federal election law.
Musk, who has been aggressively campaigning for Donald Trump, has said voters who want to be eligible for the prizes do not need to register as Republicans or vote.
As part of that effort, Musk announced in October that he would randomly award a $1m prize to people in battleground states - Pennsylvania, Georgia, Nevada, Arizona, Wisconsin, Michigan and North Carolina - every day until 5 November.
To be eligible to win, the giveaway requires registered voters to release personal identifying information, like addresses and phone numbers. They are also required to sign a pledge that says they support the US Constitution.
So far, nine $1m-prize winners have been announced, the latest a man from Michigan.
Vice President Kamala Harris and Trump, whom Musk supports, remain locked in tight races in the battleground states.
Musk's move has been met with swift backlash from Democrats who are accusing him of attempting to buy votes, and has also drawn legal scrutiny.
“America PAC and Musk are lulling Philadelphia citizens... to give up their personal identifying information and make a political pledge in exchange for the chance to win $1 million,” according to the district attorney's lawsuit filed on Monday. "That is a lottery. And it is indisputably an unlawful lottery."
The lawsuit also accuses Musk of violating consumer protection laws by deploying "deceptive, vague or misleading statements" that could create confusion.
District Attorney Krasner has asked for an immediate injunction before the presidential election because, he says, the "scheme" was hatched to "influence voters".
A court hearing on Mr Krasner’s request for a preliminary injunction has been set for Friday morning in Philadelphia - three days before election day.
The lawsuit makes clear that it is not accusing Musk and America PAC of violating federal laws prohibiting vote buying.
A representative for America PAC told ABC News after the lawsuit was filed that it was fair to "infer" the PAC plans to continue handing out the $1m cheques.
The BBC has reached out to Musk's America PAC for comment.
Legal experts told the BBC that whether the giveaway violates federal law is a bit of a grey area.
Last week, the Justice Department sent a letter to America PAC warning that his lottery-style giveaway may be illegal.
It was sent by the DOJ's Public Integrity Section following outrage from Democrats over the cash stunt.
Under US law, it is illegal to pay people to register to vote. But it remains unclear whether the sweepstakes breaks any laws.