Andrew Rowe, 31, who befriended his victim's family during his work with Staffordshire Police's child abuse investigation unit, admitted five sexual offences when he appeared at Birmingham Crown Court by videolink.
The charges included two of inciting a child to engage in sexual activity, one of meeting a child following sexual grooming and one of sexual activity with a child.
It is known that Rowe, who was remanded in custody pending the preparation of pre-sentence reports, sent hundreds of inappropriate messages to his victim, using both Facebook and a mobile phone.
Rowe had tried to cover his tracks by deleting phone and computer evidence.
John Attwood, prosecuting, told the court: "This defendant engaged in what may be described as sexual grooming of this girl in a number of regards."
Rowe, a former detective constable with 12 years' service, was based in Stafford.
Staffordshire Police's Assistant Chief Constable, Marcus Beale, said after the hearing: "Andrew Rowe has admitted serious offences under the Sexual Offences Act and is rightly facing a significant prison sentence.