Former headteacher of Chippenham's Abbeyfield School David Nicholson has resigned from his current role at a school in Basingstoke following allegations he tried to set up a threesome with a prostitute who he wanted to spank while she was dressed as a schoolgirl.

The Sun newspaper claimed Mr Nicholson, 48, sent the woman explicit messages saying he was keen on her dressing up like a pupil and was looking forward to putting her over his knee.

The father-of-four along with the chair of governors at The Costello School, Carol Bode, put out a letter to parents yesterday.

The letter reads: “Following recent allegations made in the national media regarding our Head teacher David Nicholson, it is with regret that the Governing Body has accepted his resignation which we consider to be in the best interests of his family and the whole school community.

“I can confirm that there are no concerns of any nature relating to safeguarding.”

According to the national newspaper Mr Nicholson apparently used his school email address to contact an £150-an-hour escort through an adult website and arrange a meeting with her and another woman.

When one of them replied telling him she liked dressing up as a schoolgirl and being spanked, he allegedly responded ‘I love this and would be keen.’ In a statement he said: “As I am sure you will understand, the recent press coverage has been highly distressing.

“Although I have been very grateful for the many messages of support and understanding, I have to put both the interests of my family and the school community first. It is therefore, with huge regret and disappointment that I have taken the very difficult decision to resign as Head teacher of the Costello School.

“ I have been very privileged to have served as Head teacher of the school and proud of the opportunities I have set up. I wish all at the school every good fortune in the future.”

Mr Nicholson worked at the Chippenham school for eight years and was headteacher for three years before moving to Costello School in Basingstoke, Hampshire, last September.

The paper claimed he organised a liaison in a hotel room on a night when he was due to be working away from home.

But he was forced to call off the plan when the meeting he was using as a cover was cancelled. He promised to stay in touch with the women to set up a new date, it is claimed.

Mr Nicholson, who lives in Great Bedwyn with his wife Karina, a parish councillor, denied the claims and said he was mortified by the situation.