A prisoner laughed and joked after saying an inmate he stabbed to death 'got what he deserved'.
The killer, who was serving four years and nine months for burglary, then hid the weapon in prison showers.
But he was overheard by guards telling fellow cons: "Everyone seen it, I've given him what he deserves."
CCTV revealed build-up to killing
Gray struck on the day O'Donnell - serving a five-year sentence for inflicting grievous bodily harm - arrived on the jail's E Wing.
John Benson, QC, prosecuting, said the case involved "a life taken over something of very little value, namely a DVD player".
He said it was recorded as being in O'Donnell's property when he arrived, but Gray now insisted it was his.
Liverpool Crown Court heard there was no contact between the pair before Gray went to O'Donnell's cell at 5.49pm.
CCTV footage showed he waited until O'Donnell had gone before taking the item, which eventually ended up in his cell.
When O'Donnell discovered it was missing, he reported it to a prison officer, but headed to Gray's empty cell with another inmate.
Victim never saw killer coming
That prisoner got it back for him, but Gray was watching from a landing above and went to another cell to collect the shank.
He ran down two flights of stairs, caught up with O'Donnell and lunged at his chest, then fled back to the second floor.
O'Donnell, who never saw Gray coming, walked back to his cell and collapsed, before the alarm was raised.
Mr Benson said the murder weapon was a "metal cylinder like item with a sharpened point", 19.3cm long and 1.2cm wide.
Cameras captured Gray head to the shower block, where he hid the weapon, after failing to put it down a drain.
When the dad-of-one bragged about what he'd done, one inmate shouted back: "He's gone, he's gone, you KO'd him".
Gray, of no fixed address, replied "that's what you get when you come in my pad", adding: "Is that me done? Am I getting a 25?"
Told that guards had got his "thing" and asked "why didn't you flush it?", he replied: "I couldn't flush it, it was too big. Oh f*** it."
O'Donnell, who suffered a 9cm deep wound, was taken to hospital by ambulance but died at around 7.50pm.
Gray was arrested and taken to a custody suite, where police described him being "relaxed" and saying: "At least I'm young."
Mr Benson said: "He was seen to be laughing and joking about football and seemed unperturbed about what had happened."
Gray has eight previous convictions for 13 offences, mostly for burglary and theft, but none for violence.
Caught with shanks before murder... and after
However, prison records showed he was caught with improvised weapons in jails three times previously.
They included one fitted with a razor blade, another a coat hanger hook and thirdly two metal blocks in a sock.
Gray, who was transferred to HMP Altcourse, in Fazakerley, admitted murder on March 18.
But just five days later, guards searched his cell and found another shank, hidden between his mattress and a wall.
Gray said the sharpened piece of metal was "for his own protection because of what he was in for".
Two doctors found Gray, who now claimed to be remorseful and to feel "terrible", had attention deficit hyperactivity disorder (ADHD).
Mr Benson said if Gray did steal the DVD player, the "sense of outrage and disrespect he expressed to both experts because the deceased had taken his DVD player appears to be somewhat disingenuous and ill-founded".
Richard Littler, defending, said whoever it belonged to, his client's actions could not be justified.
He argued the prison environment meant Gray had not taken the weapon to the scene, which carries a higher sentence.
Mr Littler also suggested he didn't intend to kill O'Donnell and only struck one blow with "moderate force".
Judge Andrew Menary, QC, accepted he didn't intend to kill, but said: "Without warning he plunged this fearsome weapon into this man's chest, in the region of his heart."
Mr Littler said his client's ADHD contributed to the killing, he was immature, had been bullied previously in prison and was vulnerable.
He said Gray had been in and out of jail since he was 15, had little education or support save for his sick mum, and no contact with his ex-partner or 18-month-old child.
Victim "no angel" but "loved and cherished"
O'Donnell's mum, his fiance and his ex-partner - the mum of his four children - told the court they were devastated by his loss.
Judge Menary said the victim "may have been no angel" but it was clear "he was a loved and cherished son, brother, father and partner".
He said: "Their lives have been damaged irreparably by this senseless attack."
The judge said it was not necessary for him to rule on who the DVD player belonged to.
However, he said: "The burden of the evidence would suggest that the item belonged to Mr O'Donnell and had been wrongly taken."
Judge Menary added: "You reaction - either to a perceived wrong or because you arrogantly thought you were entitled to keep this item was grotesquely out of all proportion to these unfolding events."
He concluded Gray "undoubtedly" did take the weapon to the scene and jailed him for life with a minimum of 18 years and four months.
The judge told Gray: "The things said by you at that time indicated that you believed he deserved it and any concern you had was only for your own predicament."