A police detective who once made national news when he took out a search warrant to photograph the genitals of a teen sexting suspect killed himself Tuesday as his fellow law officers were attempting to arrest him on child sex abuse charges, officials said.

David Edward Abbott, 39, a detective for the Manassas, Virginia, police, barricaded himself in his home then shot himself as Prince William County police tried to serve warrants charging him with indecent liberties and using a communications device to solicit sexual offenses, the county police said.

The warrants stemmed from an investigation involving communications between Abbott and a 13-year-old boy he met while coaching for a local hockey league. Police say the contact began two years ago and included soliciting sexual acts by phone, text, social media and email.

Authorities say Abbott also had inappropriate communications with another hockey league player dating to 2008, when the victim was 13.

Abbott served on a task force that investigates crimes against children, police said.

He was the lead detective in a sexting case that drew national attention last year after Abbott obtained search warrants authorizing police to take photos of a 17-year-old boy's genitals in a sexually aroused state so that they could be compared to a photo the boy allegedly sent to his 15-year-old girlfriend.

Police and prosecutors never followed through on the search warrant.

Abbott later filed a defamation lawsuit against the boy's attorney after she told reporters that Abbott's pursuit of the sexually aroused photos was "crazy." The lawsuit was eventually withdrawn.

Click for more from Fox 5.