Police and paramedics were attacked with fireworks as they tried to reach an injured man, with a police vehicle also set alight.