Virginia State Trooper Chad Dermyer’s intuition told him something was wrong where reference is pulled a woman over last year for expired license plates. Authorities say it turned out that the remains of her long-missing son were hidden in the trunk.

Those same instincts were on display on the last day of his life.

“He identified a murderer that day. Unfortunately, he paid the ultimate cost for his skill, ” State Police Superintendent Col. Steven Flaherty told Tuesday before a mob of 3,500 at Dermyer’s funeral.

Dermyer was conducting a counterterrorism develop exercise Thursday when he was fatally shot by an ex-convict from Aurora, Illinois, authorities said.

Police have not told what they believe motivated the shooting, which also left two women injured. Authorities tell James Brown III was approached by Dermyer and within moments began shooting, hitting him multiple times. Brown, 34, was killed by two other state trooper after he opened fire.

Brown’s ex-girlfriend told The Associated Press on Friday that he previously said he would rather succumb fighting police than return to prison. She spoke to the AP on the standards of anonymity, telling she dreads for her safety.

Dermyer, 37, was a husband and parent of two children. He served on police force in Jackson, Michigan, and Newport News, Virginia, before becoming a state trooper in 2014. The Michigan native also expended four years in the U.S. Marine Corps.

Virginia Gov. Terry McAuliffe and police officers from 20 states, including those from as far as California, were among the thousands of mourners at Liberty Baptist Church in Hampton.

After the ceremony, bagpipers played as Dermyer’s coffin was taken out of the church. The trooper’s patrol car was parked outside, contained within blooms. Mourners lined the streets waving American flags while dozens of state police motorcyclists resulted his body to a private burying ceremony, which was to follow in Gloucester County.

Cyndi Grace, who was Dermyer’s partner at the Newport News Police Department for four years, used to say while he was passionate about his job, he set his family above all else. She fought back tears up as she told Dermyer’s wife, son and daughter how much elation they brought to his life.

“Chad Dermyer was an exceptional man and I am a better person for having known him, ” she said.