A man who shot at a Denver police officer sitting in a patrol vehicle Wednesday died after an exchange of gunfire, police said.

The officer was shot three times in the torso but all the rounds were stopped by his bulletproof vest, Denver police chief Ron Thomas said. The officer was in "significant discomfort" but in stable condition at a hospital, he said.

The shooting happened outside a hotel near downtown Denver at around 4 a.m.

VIDEO SHOWS COLORADO WILDLIFE OFFICER FREEING BEAR THAT BECAME TRAPPED INSIDE TRUCK WITH FOOD

Colorado Fox News graphic

A man who shot at a police officer in a patrol car has died after a police shootout in Denver. 

CLICK HERE TO GET THE FOX NEWS APP

According to Thomas, the officer was sitting in a patrol vehicle near the hotel entrance when he saw a man walk inside the hotel and then out again. The man, whose name has not been released, then began shooting at the officer first from the passenger side of the patrol car and then the driver's side.

The wounded officer was able to get out of the car, take cover and exchange shots with the suspect, Thomas said.

There was no confrontation or words spoken before the man began firing, he said.