A paedophile who strangled a six-year-old girl with a skipping rope, yesterday lost his bid to be released from the State Hospital, Carstairs, where he has been detained for nearly 25 years.

Michael Wilkinson admitted he was a sexual deviant but argued that the courts were obliged to order his release since he was not suffering from any mental disorder.

However, three appeal judges at the Court of Session have backed the decision of Sheriff Frank Keane, who decided that Wilkinson, 52, is suffering from a mental disorder characterised by an anti-social personality, lack of feeling for others, lack of remorse for past offences, abnormal aggression, and seriously irresponsible conduct.

Sheriff Keane was provided with a medical report which stated: ''There remains an unacceptable risk that Wilkinson will offend again against children.''

He also heard evidence from five psychiatrists - three of whom said Wilkinson was suffering from a mental disorder, and two that he was not.

Wilkinson's appearance before the sheriff at Lanark was his third attempt to gain his freedom, and when his case was rejected in April 1996, he appealed to the Court of Session.

At a hearing before Lord Marnoch in October 1997, Wilkinson was punched in the face by a relative of Pauline McIvor, who he had sexually assaulted and strangled in Dundee in 1974.

Lord Marnoch rejected the appeal and Wilkinson took the case to three judges.

Lord McCluskey, who heard the appeal with Lord Justice Clerk Cullen and Lord Kirkwood, said Wilkinson had been detained without limit of time in Carstairs in September 1974, after being convicted of culpable homicide.

The main issue in the case arose from the fact that since at least 1974, Wilkinson had been and was a paedophile. Wilkinson argued, however, that there was no other feature of his personality to warrant the conclusion that he was suffering from a mental disorder under the 1984 Mental Health (Scotland) Act.

The Act states that no person should be regarded as suffering from a mental disorder if the only feature is sexual deviancy, for example paedophilia.

Wilkinson argued that the sheriff was obliged to release him if his detention as a ''psychopath'' was founded on paedophilia and nothing else.

Lord McCluskey said: ''It is not in dispute that if the sheriff were to be satisfied, upon the evidence, that the only reason why the doctors were describing Wilkinson as 'suffering from a mental disorder' was that he was a paedophile, there would be no basis whatsoever for holding that he was suffering from mental disorder within the meaning of the Act.''

However, he said the resolution of that issue was abundantly clear in the sheriff's finding that Wilkinson was suffering from mental illness manifested by abnormally aggressive and seriously irresponsible conduct. It is clearly stated that Wilkinson suffers from a psychopathic disorder, one feature of which is abnormal aggression.

''It is clear that the sheriff was not regarding Wilkinson as a person suffering from mental disorder by reason only of his sexual deviancy in the form of paedophilia.

''It is clear that there may be people disposed to, affected by and exhibiting sexual deviancy, even engaging in sexually deviant conduct, who could in no sense be regarded as suffering from mental disorder in terms of the Act.

''It is, however, clear that a person who is suffering from mental disorder, for example because he is a psychopath who persistently engages in abnormally aggressive and seriously irresponsible conduct, may manifest that conduct in the field of his deviancy, for example in relation to his sexual contacts with young children.

''Such a person would be treated as suffering from mental disorder by reason of his psychopathic condition manifested by such conduct and not only by reason of the deviancy.''