MILWAUKEE — A Milwaukee police officer fired over social media posts he made mocking the stun-gun arrest of an NBA basketball player lost his appeal to get his job back.

The Fire and Police Commission upheld the firing of Erik Andrade Wednesday after a two-day hearing. Police Chief Alfonso Morales said he fired Andrade because his posts violated the department’s social media policy and compromised the officer’s ability to testify in other cases.

Milwaukee Bucks guard Sterling Brown sued the police department in June and accused officers of using excessive force and targeting him because he’s black. A group of officers swarmed on him in a Walgreens parking lot because he didn’t immediately remove his hands from his pockets while he waited for a parking citation on Jan. 26.