Police on the street were confronted by others amid shouts before they were attacked and retreated.