A police officer who was sacked after he was accused of throwing a female prisoner head first on to a concrete floor will get his job back following a legal ruling today.

The Chief Constable of Wiltshire failed in an attempt to block Sergeant Mark Andrews being reinstated to his role on the force.

Mr Andrews was sacked after being seen on CCTV in July 2008 dragging Pamela Somerville across the floor at Melksham police station, before shoving her into the cell.

He was found guilty of causing her actual bodily harm and jailed for six months, but was released on bail after spending only six days in prison and in November 2010 his conviction was overturned on appeal.

Despite this, in December 2010 a police disciplinary panel found that Mr Andrews should be sacked with immediate effect.

The following year, the Police Appeals Tribunal (PAT) quashed that decision and said he should be reinstated at his former rank, but fined 13 days' pay.

Wiltshire Police had applied for a judicial review to challenge this decision, but it was rejected today.

Current Chief Constable Pat Geenty said: "This has been a lengthy legal process, but one which we believe was necessary and right to follow.

"I do not believe it would be reasonable or proportionate to seek any further legal appeal.

"To that end, I will now enter into discussions with Mark Andrews and his representatives in relation to his integration back into Wiltshire Police as a warranted police officer.

"The Police Appeals Tribunal accepted that Mark Andrews' actions were intolerant and discreditable and I felt they were a disgrace - there was no place in Wiltshire Police for this behaviour then nor is there now.

"While I believe the Police Discipline Panel's decision to dismiss Mark Andrews was correct, I accept the legal authority which states he must be reinstated."

In the judgment handed down today, Mr Justice Ouseley was critical of former Wiltshire Chief Constable Brian Moore, saying all the grounds raised for the application were "unarguable".

The judge said the decision by the appeal tribunal was "obviously rational", and added: "I was also troubled by the hostile attitude he displayed towards Mr Andrews.

"His strenuously expressed views rather underplay the fact that no previous complaint against Mr Andrews had been upheld.

"I expect that the order for reinstatement made by the PAT and upheld by me will be implemented with full regard to its conclusions, and the failure of this unarguable challenge."

Ms Somerville was arrested after she was found asleep in her car near her Colerne home.

She was detained for failing to provide a sample for a breath test, but she denied any wrongdoing and the charges were dropped due to insufficient evidence.

Former soldier Mr Andrews, who is married with two children, claimed she was unpredictable and abusive, and that she had been holding on to the cell door frame before suddenly letting go.

He said: "It was like pulling a cork out of a bottle."

Ms Somerville needed stitches to a gash above her eye following the incident, but at the criminal appeal Mr Justice Bean said he felt satisfied Mr Andrews did not intend to throw Ms Somerville into the cell and the injuries she suffered "were probably caused by her falling to the floor after letting go of the door frame".