Elon Musk was sued by the Philadelphia district attorney over his political action committee’s $1 million a day sweepstakes targeting swing state voters in the final days of the U.S. presidential election.

The DA, Larry Krasner, is asking a state court to stop Musk from engaging in an “unlawful lottery,” which lulls “Philadelphia citizens to give up their personal identifying information and make a political pledge in exchange for the chance to win $1 million.”

The civil lawsuit is the first official legal challenge that Musk has faced over the program. Legal experts have questioned the lawfulness of the effort since it was announced, and last week the U.S. Department of Justice sent Musks’s PAC a letter warning that it might violate federal law.

Musk’s pro-Trump America PAC had been giving away $1 million every day until Election Day on Nov. 5 to a randomly selected signatory of a petition calling for free speech and the right to bear arms. The winner must be a registered voter. The contest doesn’t specify which candidate voters should cast their ballots for.

After the lawsuit was filed, a spokesman for the PAC pointed to a social-media post highlighting that the giveaway is continuing. An email to Musk’s lawyer wasn’t immediately returned.

Krasner says that the giveaway violates state lottery and consumer protection laws. Since launching the sweepstakes, Musk’s PAC has given $1 million checks to nine people, four of whom live in Pennsylvania, according to the lawsuit.

The suit focuses on allegations that the giveaway isn’t really random and favors people who show up at rallies. While prosecutors typically bring criminal cases, they can file civil lawsuits when they feel it’s appropriate.

“The Philadelphia district attorney is charged with protecting the public from public nuisances and unfair trade practices, including illegal lotteries,” Krasner said in a statement. “The DA is also charged with protecting the public from interference with the integrity of elections.”

The case is Commonwealth of Pennsylvania by District Attorney Lawrence Krasner v. America PAC and Elon Musk, Pennsylvania Court of Common Pleas.

— With assistance from Chris Dolmetsch, Bill Allison and Zoe Tillman.

Our website is the place for the latest breaking news, exclusive scoops, longreads and provocative commentary. Please bookmark nationalpost.com and sign up for our daily newsletter, Posted, here.