Richard Munro, who once headed CID at Fife Constabulary, needed hospital treatment after he was hit on the head with a sock filled with pool balls.
The 53-year-old had just arrived at Dumfries Prison to start a five-year sentence for withholding evidence from prosecutors investigating a murder.
A source said: “It happened almost as soon as he arrived. He got battered with pool balls in a sock.”
Munro, a former detective chief superintendent who once earned in excess of £70,000 a year, was rushed by ambulance to Dumfries and Galloway Royal Infirmary and received treatment.
A spokeswoman for NHS Dumfries and Galloway said: “We can confirm that a 53-year-old man was admitted and treated on 5 August. He was discharged the same day.”
Former police officers who end up in jail are often targeted by resentful prisoners.
But one man who was wrongly convicted as a result of Munro’s crime yesterday urged fellow prisoners to “leave him alone to serve his sentence”.
Steven Johnston, who was wrongly convicted of killing Andrew Forsyth in Dunfermline 17 years ago and spent ten years in jail, said: “That’s not what I wanted at all.
“I can assure you it’s not doing me any favours. I’d rather people leave him alone to serve his sentence.”
A spokesman for the Scottish Prison Service (SPS) said: “In the event of any incident, the matter would be reviewed. Security would be looked at.”
Munro was found guilty of engineering the case that led to Mr Johnston and Billy Allison’s convictions for the murder of Mr Forsyth during a drunken row in 1995.
Information that could have helped the pair’s defence was withheld by Munro.
Mr Johnston’s and Mr Allison’s murder convictions were quashed in 2006 by appeal court judges who expressed “grave misconduct” over the conduct of police.
Lothian and Borders Police were called in to investigate the case and after a two-year inquiry uncovered enough evidence against Munro for him to be prosecuted for attempting to defeat the ends of justice.
Judge Lord Doherty, passing sentence, said Munro “contributed substantially to the convictions of Johnston and Allison being miscarriages of justice”.
It is understood that Munro was held at another prison following his sentencing at the end of July before being transferred to Dumfries.
Steven Cosans, Munro’s stepson, declined to comment on the alleged assault added: “The most honest and hardworking man I have ever met faces years in jail. If this is the kind of country modern Scotland has become, I am ashamed to call myself a Scotsman.”
Police have launched an investigation with the Scottish Prison Service (SPS) pledging to support it “in any way we can.”