A man was arrested Thursday evening after he apparently randomly attacked police officers and, later, bit a police dog.

About 10 p.m., the man spotted gang detectives while he was standing near a van about 1200 W. Lexington Ave. Officers said the man started yelling at them before getting into his van and driving toward them “at a very high rate of speed,” according to a news release.

The man was reportedly trying to ram the officers’ vehicle, but police narrowly avoided that attempt. The man then stopped his vehicle in the middle of the road, and yelled and revved his engine at officers. He drove at them and backed away multiple times, before ramming into the police vehicle head-on as other officers arrived at the scene.

The impact disabled the man’s vehicle, and police tried to arrest him. Officers used a Taser in the process, but it was “ineffective,” according to the release. They then brought in a police K-9 to pull the man out of his vehicle.

The man apparently bit the dog as it was biting him, police spokesman Detective Matt Roper said, but the man was taken into custody.

The man was booked into jail on suspicion of aggravated assault on a police officer, criminal mischief, assault on a police service animal, resisting arrest and possession of drug paraphernalia.

The officer and dog were injured in the confrontation, but both will recover, Roper said.