Updated

Virginia State Trooper Chad Dermyer's intuition told him something was wrong when he 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 price for his skill," State Police Superintendent Col. Steven Flaherty said Tuesday before a crowd of 3,500 at Dermyer's funeral.

27bc87ed-

Trooper Chad Dermyer, right, receiving his graduation diploma from Superintendent Col. W. Steven Flaherty in 2014. (Virginia State Police via AP)

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

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

Brown's ex-girlfriend told The Associated Press on Friday that he previously said he would rather die fighting police than return to prison. She spoke to the AP on the condition of anonymity, saying she fears for her safety.

Dermyer, 37, was a husband and father of two children. He served on police forces in Jackson, Michigan, and Newport News, Virginia, before becoming a state trooper in 2014. The Michigan native also spent 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, covered in flowers. Mourners lined the streets waving American flags while dozens of state police motorcyclists led his body to a private burial ceremony, which was to follow in Gloucester County.

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

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