A Boulder County sheriff’s deputy shot a man near U.S. 287 and North 107th Street north of Longmont at about 5:30 p.m. Saturday after the man first shot out a window of the deputy’s patrol car, the department reported.

The gunman’s condition is not known and the Boulder County sheriff’s office said the deputy was not injured.

Motorists flagged deputies to an unidentified man walking along the roadway with a weapon tucked in the waist of his pants and acting aggressively toward passing vehicles, the Boulder County sheriff’s office said in a statement.

The gunman fired as the deputy approached. The deputy, who was not identified, returned fire and hit him several times, the statement said. The suspect was transported to an area hospital and his condition was unknown.

The deputy was not injured and roads around the shooting were shut down as officers investigated.