Officer Dominic "Nick" Winum had been with the Town of Stanley Police Department since 2016.
CNN  — 

A police officer in northern Virginia was shot to death Friday afternoon during a traffic stop, and responding law enforcement fatally shot his killer, authorities said.

Officer Dominic “Nick” Winum, 48, had been with the Town of Stanley Police Department since 2016, according to Police Chief Ryan Dean. Prior to that, Winum served as a trooper with the Virginia State Police, which also extended condolences.

“It is with heavy hearts this evening that we must inform our community of the line of duty death of one of our own,” Dean announced in a Facebook post. “I know the Stanley and Page County community are keeping Nick and his family in their prayers during this most difficult and tragic time.”

In a subsequent statement on its Facebook page, the Stanley Police Department said Winum had initiated a traffic stop, but before the officer could exit his patrol car the suspect got out of his vehicle and opened fire. The shooter, identified as 29-year-old Dakota G. Richards, fled into nearby woods on foot.

Authorities pursued Richards and found him hiding in a barn; Richards “made a threatening movement and was shot by Page County Sheriff’s Deputies,” the statement said.

Virginia State Police is investigating both shootings. CNN has reached out to the Stanley Police Department and Virginia State Police for comment.

CNN’s Shawn Nottingham and Andy Rose contributed to this report.