The Manchester and Salford Magistrates' Court heard that the attacker, Karl Anderson, had 25 convictions for 37 offences, including football-related violence, the BBC reported. The 29-year-old will pay a 100 pound (€112) fine.
Anderson apologised for his actions, which involved kicking Sterling four times and abusing the player using racist language during the "unprovoked" assault outside City's training ground on Saturday.
Sterling said he "did not think this kind of behaviour happened in this country in this day and age" in his victim impact statement read out to the court. The 23-year-old England international scored twice in City's 4-1 win over Tottenham Hotspur at the Etihad Stadium on Saturday evening.