A virtual Lolita that poses as a 14-year-old schoolgirl to trap paedophiles on social network sites has been created by scientists.

The conversational agent or "chatbot" known as Negobot is a sophisticated computer program capable of fooling sexual predators into believing she is real.

One police force in Spain, where she was created, has already shown an interest in employing the undercover cybercop.

Download the new Independent Premium app Sharing the full story, not just the headlines

Placed in a forum where a paedophile is thought to be lurking, Negobot starts off as a passive and neutral participant in general online chatter.

As conversations become more intimate or suggestive, and the "target" begins to employ grooming tactics, her behaviour changes in ways designed to lure him in.

The chatbot might appear insistent or offended, and an attempt to obtain personal information will cause Negobot to try to find out more about the suspect.

Scientists used game theory, a mathematical system of strategic decision making, to make her behaviour more convincing.

A split personality with seven different conversation patterns adds to the realism. Other tricks include inserting "typos", abbreviations, and deliberate language errors, to mimic the actions of a young teenager.

One of Negobot's creators, Dr Carlos Laorden, from the University of Deusto, said: "Chatbots tend to be very predictable. Their behaviour and interest in a conversation are flat, which is a problem when attempting to detect untrustworthy targets like paedophiles.

"What is new about Negobot is that it employs game theory to maintain a much more realistic conversation."

Not only could the program resume discussions separated in time, but it was able to "take the lead" in conversations and use slang expressions.

The team had a collaborative agreement with the Ertzaintza, the Basque Country police force, which had shown "considerable interest", said Dr Laorden.

"Negobot has already been implemented and trialled actively on Google's chat service and could also be translated into other languages," he added. "We do not discard the possibility of bringing it to new channels in the future and we believe it could be a very useful tool for social networks to incorporate."

Despite having a high degree of artificial intelligence, Negobot's powers of conversation are still limited, the researchers point out. She is unable to detect linguistic subtleties such as irony, for instance.

PA