ATLANTIC CITY, N.J. — Atlantic City’s mayor admitted stealing $87,000 from a youth basketball team he founded, becoming the latest in a line of corrupt city officials so long that it spawned a hit HBO TV series.

Frank Gilliam Jr. appeared Thursday in federal court in Camden, where it emerged that half that amount of money he took from the Atlantic City Starz was recovered from his home when FBI agents raided it last December.

Judge Joseph Rodriguez informed Gilliam that his guilty plea may mean he could no longer hold public office. He was released after posting a $100,000 bond with the court.

Gilliam told the judge he stole funds raised from donors in Atlantic City and Philadelphia, using the money for personal expenses from 2013 and 2018. He was elected mayor in 2017 after serving as a City Councilman.

“When a scheme depletes (a) charity for children, it's unconscionable,” said FBI Special Agent in Charge Gregory Ehrie. “But when the fraud is perpetrated by someone the public trusts, it damages the community's confidence in their public servants. This defendant betrayed the trust of his community and of people who wanted to improve the lives of children.”

Gilliam’s lawyer, Harry Rimm, stressed that Gilliam admitted taking private money, not public funds. That sets him somewhat apart from a long line of his corrupt predecessors, dating back to the turn-of-the-century Atlantic City officials whose malfeasance was chronicled in the HBO series “Boardwalk Empire.”

“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," Rimm said in a statement issued after the court appearance.

U.S. Attorney Craig Carpenito said Gilliam solicited donations while a member of the City Council and then as mayor under the false pretense that they were for the youth basketball team or for school supplies for poor children.

In reality, the prosecutor said, Gilliam used the money for personal expenses including luxury clothing, expensive meals, and trips.

FBI agents carried off numerous cardboard boxes and computer equipment during a raid of the mayor’s home on Dec. 3, but they remained silent about why they were there and what they had taken away.

Gilliam, 49, could face 20 years in prison when he is sentenced on Jan. 7. He also agreed to make restitution for the fraud.

The mayor left his home early Thursday clutching his passport, and declined comment to reporters other than to say, “Have a good day.” Surrendering a passport is commonly done when a defendant faces federal charges to prevent them from leaving the country.

As recently as 2007, four of the city’s last eight mayors had been arrested on corruption charges and one-third of the nine-member City Council was either in prison or under house arrest.

City Council President Marty Small was expected to take over as acting mayor, city officials said.