WASHINGTON — A Virginia police detective shot and killed himself Tuesday as police were attempting to charge him for having inappropriate contact with two young boys.

Prince William County Police say officers tried to serve David Edward Abbott Jr., 39, multiple arrest warrants at a home in Gainesville when Abbott refused to surrender.

Police evacuated nearby homes after believing Abbott was armed. Abbott took out a handgun and killed himself while officers were trying to talk with him.

Abott was a Manassas City police detective and served on the Northern Virginia-Washington D.C. Internet Crimes Against Children Task Force.

He was accused of having inappropriate contact with two young boys while he was a youth hockey coach for a local Prince William County league.

Police said Abott began the inappropriate communication with one of the victims in 2013 when the boy was 11 years old. He solicited sexual acts through phone, text, social media and email. He also saw the boy face-to-face, police said.

Detectives learned of a second victim who Abbott also met while he was a hockey coach. Inappropriate contact with the second boy began in 2008 when the victim was 13 years old, police said.

The Manassas City Police Department released the following statement on Abbott’s death:

Manassas City Police Department is mourning the loss of one of our officers, who took his own life at his

home in Prince William County early today. On Dec. 14, 2015, Manassas City Police was notified by

Prince William County Police that an allegation of criminal misconduct was made against a Manassas

City Police Officer. The Officer was identified as Det. D. E. Abbott, Jr., who was assigned to the Northern

Virginia-Washington, DC (NOVA-DC ICAC) Internet Crimes Against Children Task Force. While Manassas City Police fully cooperated and assisted Prince William County Police with its investigation into the allegations, Manassas City Police played no direct role in interviewing Det. Abbott about the charges prior to his taking his own life on the morning of Dec. 15, 2015. Through their investigation, Prince William County Police obtained felony warrants for Indecent Liberties with a Minor (X2) and Use of a Communications Device to Solicit a Minor (X2) against Det. Abbott. Prince William County Police is still heavily involved in investigating the allegations to ensure justice and that victim assistance is made available for any potential victims and their families. This is a tragic and sad day for the Abbott family, the juvenile victims and their families, the Manassas City Police Department, and our community. In spite of these recent developments regarding the serious allegations against him, we are grateful for the contributions Det. Abbott made during his time with Manassas City Police, to include the prosecution and conviction of hundreds of criminals. His family and peers request privacy during this time as we grieve and struggle to accept the realities of such a loss.

Abbott was the lead detective in a high-profile case in 2014 in which Prince William County authorities sought to take sexually explicit photos of a 17-year-old’s genitals to compare with the evidence.

Follow WNEW on Twitter