A handcuffed student sobbed as he was jailed for mocking footballer Fabrice Muamba on Twitter after he collapsed during a match.
Liam Stacey, 21, of Pontypridd, South Wales, broke down as he was given a 56-day custodial sentence for making what a judge called "vile and abhorrent" comments.
He briefly fell into the arms of his mother as he passed the public gallery at Swansea Magistrates' Court as he was taken away.
Football fans watched in horror as 23-year-old Muamba collapsed from a heart attack during an FA Cup tie against Tottenham Hotspur on Saturday March 17.
Millions more witnessed the plight of the Bolton Wanderers midfielder as the match at White Hart Lane was screened live on TV.
While his fight for life touched hearts around the world, a drunken Stacey went online to mock. The first thought of the Swansea University undergraduate was to post the tweet "LOL (laugh out loud). **** Muamba. He's dead!!!"
In what only amounted to a handful of minutes, Stacey posted a series of increasingly racist tweets which he would live to regret.
His jail sentence was seized upon as sending out a stiff warning that racism on the internet will not be tolerated.
Jim Brisbane, Chief Crown Prosecutor for Wales, said: "Racist language is inappropriate in any setting and through any media. We hope this case will serve as a warning to anyone who may think that comments made online are somehow beyond the law."
Stacey is still the subject of an internal investigation at Swansea University. A spokesman said: "The student remains suspended from the university pending the conclusion of our disciplinary."