A Northern Virginia community is in shock after they learned a decorated police detective -- who had investigated online crimes against children -- was himself suspected of having inappropriate contact with two young teens.

David Edward Abbott, 39, of Gainesville, Virginia, killed himself Tuesday morning moments before police could serve him with search and arrest warrants.

Abbott was a Manassas City detective. He had served on the Northern Virginia-Washington, D.C. Internet Crimes Against Children Task Force and was involved in high profile sex crime cases.

Police were investigating Abbott of having inappropriate conduct with two victims while Abbott was a Prince William youth hockey coach. He was to be charged with two counts of taking indecent liberties and two counts of using a communications device to solicit sexual offenses.

Police said Abbott made contact with the first victim when the boy was 11 years old.

According to police, Abbott solicited sex acts over phone, by text and through social media and email. He also had face-to-face contact with the boy, police said.

During the investigation, police discovered a second victim, whom Abbott contacted when the boy was 13 years old.

Some of the offenses date back to 2008, police said.

In 2014, Abbott was the detective in a high-profile case in which a 17-year-old Manassas teen was sentenced for sending explicit texts to his 15-year-old girlfriend.

At one point, police had sought to take a photo of the 17-year-old's genitals, including some in an aroused state, to make the case.

The request led to protests from the 17-year-old's lawyer, who said at one point, "Who does this? It's just crazy."

Abbott sued the lawyer for defamation.