A Philadelphia judge will hear the city prosecutor’s bid to shut down Elon Musk’s one million dollars-a-day (£772,000) sweepstakes in battleground states on Thursday.
The giveaways come from Mr Musk’s political organisation, which aims to boost Donald Trump’s presidential campaign.
Philadelphia district attorney Larry Krasner, a Democrat, filed the suit on Monday to stop the America PAC sweepstakes.
The sweepstakes are set to run until election day on Tuesday.
Judge Angelo Foglietta will hear motions on the issue in a City Hall courtroom.
Matthew Haverstick, one of several lawyers representing the defendants, declined to say late if Mr Musk would attend the hearing.
The sweepstakes is open to people in battleground states who sign a petition supporting the Constitution.
Mr Krasner has said he could still consider criminal charges, saying he has the job of protecting the public from both illegal lotteries and “interference with the integrity of elections”.
Election law experts have raised questions about whether the scheme violates federal law barring someone from paying others to vote.
Mr Musk has cast the money as both a prize as well as earnings for work as a spokesperson for the group.
In the suit, Mr Krasner said that America PAC and Mr Musk “are indisputably violating Pennsylvania’s statutory prohibitions against illegal lotteries and deceiving consumers”.
Both Mr Trump and his Democratic rival Vice President Kamala Harris have made repeated visits to the state as they fight for Pennsylvania’s 19 electoral votes.
Mr Musk, who founded SpaceX and Tesla and owns X, has gone all in on backing the former president, saying he thinks civilisation is at stake if he loses.
He is undertaking much of the get-out-the-vote effort for Mr Trump through his super PAC, which can raise and spend unlimited sums of money.
He has committed more than 70 million dollars (£54 million) to the super PAC to help Trump and other Republicans win in November.