A killer accused of having a homemade blade in jail claimed another prisoner had planted it.
A jury found the case again Peter Brown, 53, not proven after the weapon was discovered during a random cell search by officers at HMP Shotts.
One guard noticed a tear in his mattress and pulled out a five-inch improvised weapon, which had been made by the end of a plastic toothbrush being sharpened.
READ MORE: Glasgow killer serving life in prison ordered gang to murder man in flat attack
Brown, caged after the brutal daylight slaying of a man in a park following a row over £20, immediately denied all knowledge of the weapon.
He went on trial at Hamilton Sheriff Court and said the shank had been put there by another inmate.
A jury found the charge unanimously not proven after hearing that prisoners had free access to each other's cells for large parts of the day.
Prison officer Lorraine McLean told depute fiscal Jennifer Cunningham: "During the search I had lifted the mattress off the bed and noticed it had a tear in it.
"I ran my hand over the mattress and could feel something concealed inside.
"It had to be taken because it would cause harm if it was used against somebody else."
Her colleague Sean McCracken added: "The mattress had been hollowed out to hide the weapon."
Both officers admitted they did not see Brown with the weapon at any time and were unable to say who had placed it inside the mattress in his single occupancy cell.
Sheriff Andrew McIntyre told Brown he had been acquitted and ordered him to be returned to custody.
Brown was jailed for 18 years after teaming up with two other men to stab Jason McCue, 43, in a park in Strathaven.
Horrified families and dog walkers watched as Jamie Cook, 31, his dad James Cook, 54, and Brown teamed up to murder their victim in July 2017.
Mr McCue was knifed three times including once through the heart during the lunchtime attack over the £20 debt.
All men denied killing McCue but were convicted following a trial at the High Court in Glasgow.
Lord Matthews jailed Brown for 18 years, Cook snr for 16 year and four months and Cook jnr for 17 years and three months.