Police were right to sack a constable who was in regular contact with a friend accused of child sex offences, the High Court has ruled.

PC Paul Woollard was also sacked for sending emails of a "sexist nature" from a Wiltshire Police address.

The case reached the High Court after the police misconduct panel's decision to sack him was overturned by a police appeals tribunal.

Wiltshire Police welcomed the judge's decision to uphold the dismissal.

'Public confidence'

The judge, Mr Justice Wyn Williams, was told PC Woollard had been in regular contact with his "old friend" Robert Meade in a five-month spell between Meade's arrest on suspicion of child sex offences and admitting the offence.

Meade was initially arrested in May 2009, before being released on bail pending further investigation. In October of the same year he admitted "engaging in sexual activity" with a 14-year-old girl and was given a 12-month jail term.

PC Woollard had also checked a police record relating to Meade, the judge heard.

In a written ruling, the judge said the appeals tribunal made "errors" and its decision to re-instate should be quashed.

He said: "The police appeals tribunal adopted a view of the relevant allegations which it considered was justified by the evidence without first making a judgment about whether the misconduct panel's view of the allegations was reasonable.

"It compounded this error of approach by failing to take account of a highly material factor - the maintenance of public confidence in the police service - when determining the appropriateness of the sanction imposed by the misconduct panel.

"In my judgement it is open to this court to intervene given those errors on the part of the police appeals tribunal."