A highly-decorated Flying Squad detective has been jailed for 18 months for trying to groom a schoolgirl for sex over the internet.
Algar will be banned from using a computer to contact children
Det Con Glenn Algar, 45, from Potters Bar, Hertfordshire, thought he was sending e-mails to the girl.
But he was sending the lurid messages to a colleague working under cover.
Algar had also admitted possessing child pornography. The Southwark Crown Court judge ordered him to register as a sex offender for 10 years.
Algar is now banned him from working with children for life.
The married father-of-two resigned before appearing in court on Thursday.
He had pleaded guilty to internet grooming offences and six counts of making and possessing indecent images, at a hearing in January.
Algar had been based in Finchley, north London.
"This is a highly decorated police officer who, after 26 years of service to the public, had found himself repeatedly commended by his senior officers," prosecutor Peter Zinner told the court on Thursday.
Judge Christopher Hardy told Algar the images found in his possession justified a prison term.
"You made use of those images and your making use of them and people like you who make use of such images encourages others to make them in the first place," he said.
The judge accepted the officer represented a "low risk" of similar re-offending in the future.
Algar is likely to be released in just over five months once time spent on remand is taken into account.
He will be subject to an indefinite Sexual Offences Prevention Order prohibiting the use of a computer to contact children.
Defence counsel Graham Arran, told the court his client was "genuinely remorseful" for his behaviour.