Demonstrators had battled with the police to protest a two-year prison sentence given to a leading opposition figure.