Detective David E. Abbott Jr. of the Manassas City Police Department. He committed suicide as police were attempting to arrest him on child molestation charges on Dec. 15, 2015. (Manassas City Police Department)

A Manassas City police detective, who was the lead investigator in a controversial teen “sexting” case last year, shot and killed himself outside his home Tuesday morning as police tried to arrest him for allegedly molesting two boys he met while coaching youth hockey in Prince William County.

David E. Abbott Jr., 39, was a member of the Northern Virginia-Washington D.C. Internet Crimes Against Children Task Force and had been an officer on the Manassas City force for 14 years. In his spare time he coached 13- and 14-year-old boys in travel hockey for the Potomac Patriots program at the Prince William Ice Center in Woodbridge, club officials said. When Prince William police learned Monday of the allegations of improper contact by Abbott over a period of years, they moved quickly.

Police said they learned that Abbott had sent inappropriate text messages and emails to a 13-year-old boy he met through the hockey program. By phone and social media, Abbott had been asking the boy for sex acts for more than two years, county police said.

Detectives then learned of a second potential victim, a boy who was 13 and was also part of the Patriots hockey club in 2008 when Abbott began sending him inappropriate messages, police said. Early Tuesday, Prince William police obtained a search warrant for Abbott’s townhouse on Senea Drive in Gainesville, where he lived with his mother. Police also obtained four felony arrest warrants — two counts of indecent liberties by a custodian and two counts of use of a communication device to solicit a sexual offense.

Police arrived at the townhouse about 2:30 a.m. Tuesday, Prince William Sgt. Jonathan Perok said. Abbott refused to surrender. Aware that the detective probably had weapons, the police then evacuated some nearby townhouses as a precaution, Perok said.

Virginia police detective and hockey coach David Edward Abbott Jr. killed himself after Prince William County police tried to arrest him for soliciting a minor on Tuesday. (WUSA9)

The standoff lasted for more than four hours. Abbott came outside of the townhouse and was speaking with officers, Perok said. Then, around 7 a.m., Abbott shot himself, Perok said.

Abbott was the lead detective in a child pornography investigation last year in which a Manassas City teen was charged with sending explicit video of himself to his girlfriend. In order to establish that the teen was the person in the video, Abbott and Prince William prosecutors obtained a search warrant to take a photo of the teen’s erect penis, for comparison with the explicit video.

The teen’s attorneys criticized the warrant as inappropriate, and the police and prosecutors later withdrew it. The teen was later placed on probation for a year, and police said in a news release that prosecutors had instructed Abbott to obtain the controversial warrant.

Abbott then sued the teen’s defense attorney and her firm, accusing them of defamation for a critical comment the lawyer made in The Washington Post. Abbott dropped the lawsuit last month, but the case was not over. The teen’s family hired Alexandria civil rights lawyer Victor Glasberg, who notified Abbott, his department and the prosecutors in August of his intent to file a federal lawsuit over their handling of the case. Glasberg said Tuesday he did not know whether he would proceed with the suit.

“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,” Manassas City police said in a statement. “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.” Abbott was the lead detective in the investigation of serial child predator Kevin Ricks, sentenced to 45 years in prison for molestations in Virginia and Maryland.

Abbott’s department said it was aware of the new investigation but did not speak with him about it prior to his suicide Tuesday.

R.J. Ziegler, general manager of the Potomac Patriots, said the hockey club was saddened by the news. “We are taking steps to ensure that the needs and well-being of the club’s children, families and staff are being attended to at this time,” Ziegler said.