SACRAMENTO, Calif. (AP) — A man smacked Sacramento Mayor Kevin Johnson in the face with a pie at a charity dinner, and the former NBA star went on the defensive, his top aide said.

The mayor had given a speech at the Seeds of HOPE dinner at Sacramento Charter High School on Wednesday night before the man pulled the pie from a bag, grabbed Johnson and shoved it in his face, said the mayor’s chief of staff, Crystal Strait.

She said Johnson defended himself, but she would not give details. A booking photo released by police shows Sean Thompson, 32, with a bruised and cut eye.

Police arrested Thompson on suspicion of assaulting a public official, which is a felony, the Sacramento Police Department said in a statement. It wasn’t clear if he had retained an attorney.

Johnson tweeted that he’s “doing fine,” adding, “Thank you to Sac PD for being there.”

Strait emphasized that it was a serious and scary situation and there was nothing funny about it, especially because no one, including the mayor, could tell immediately that it was a pie the man was holding.

“The mayor was assaulted. I was standing right there, and I’m still pretty shaken up,” Strait said, speaking some three hours after it happened.

Both police and Strait said Thompson was not previously known to the mayor and his staff.

After cleaning up, Johnson spoke again to calm nerves at the event, which was held in the school’s garden and featured many of the city’s top restaurateurs.

Johnson, who had a long career as an NBA All-Star with the Phoenix Suns and a brief stint with the Cleveland Cavaliers, has about two months left as mayor after deciding not to seek a third term.

The 50-year-old is married to Michelle Rhee, a former chancellor of Washington, D.C., schools, who was at the event Wednesday night.

Johnson’s signature achievement in office was getting a $500 million arena built for the city’s NBA team, the Sacramento Kings.

His final two years in office were marked by the re-emergence of a decades-old claim of sexual abuse from a woman who was a teenager when Johnson played for the Suns. The Phoenix Police Department investigated but did not file charges.

Johnson has denied the allegations and that they had anything to do with his decision to leave office.