Atlantic City Mayor Frank Gilliam pleaded guilty Thursday to a federal wire fraud charge for soliciting tens of thousands of dollars in donations he claimed would go to a youth basketball team — but spending the dough on himself instead.

In total, Gilliam, 49, defrauded victims of $87,215 — both during his mayoral term and his previous time as a city council member, according to a federal lawsuit obtained by the Press of Atlantic City.

Gilliam told potential donors that their contributions would benefit the youth basketball team and/or help provide school supplies to underprivileged children, according to the report.

Instead, the mayor used the donations for personal expenses, including luxury clothing, pricey meals and trips that had nothing to do with the team, authorities told the paper.

He became mayor in January 2018, and served as a member of the council between January 2009 and December 2017, according to the suit. The alleged scheme occurred from 2013 until 2018, the suit said.

Gilliam, who is only in his first term, is expected to be sentenced Jan. 7 and could face up to 20 years behind bars, according to the report.

Authorities seized more than $41,355 from Gilliam’s home, according to the Press.

Gilliam was with his wife, Shawna, and attorney Harry Rimm prior to the Thursday hearing. He did not comment when questioned about why he was in federal court.

He also did not comment to reporters when he left his house around 7:15 a.m., the paper reported.

Rimm said in a statement obtained by the Press that the charge to which Gilliam has pleaded guilty relates “only to his conduct as a private citizen, not conduct in his official capacity.”

“He is not charged with taking any public or taxpayer funds,” Rimm added. “Mr. Gilliam, who is a lifelong resident of Atlantic City, has admitted his wrongful conduct, is accepting responsibility for his actions and is genuinely remorseful.

“Moreover, Mr. Gilliam has started paying restitution, making a voluntary payment today in connection with his plea. To date, and in advance of sentencing, Mr. Gilliam has paid back almost half of the restitution amount that the parties have agreed is owed.”

Gilliam appeared before US District Judge Joseph Rodriguez, and Assistant US Attorney Sean Farrell is prosecuting the case.