The police were alerted to Stortorget in Karlshamn when a large number of people gathered to fire New Year's rockets.
But after a while, several people in a cluster chose to disguise themselves and instead aim the rockets at the police, who were allowed to take cover in their cars.
A policeman was hit by a rocket in the stomach and was slightly injured.
Two men in their late teens were arrested on the spot and later charged with a large number of crimes - including violence against an official and sabotage against blue light activities.
The older of them is now sentenced to two months in prison.
The younger is sentenced to community service.