A student who mocked footballer Fabrice Muamba on Twitter after he collapsed during a match was jailed today for inciting racial hatred.

Liam Stacey, 21, provoked revulsion with comments made while the Bolton Wanderers star still lay on the pitch.

Police were inundated with complaints as members of the public reported the student's comments.

Stacey, a Swansea University biology undergraduate, was quickly tracked down and arrested.

Last week he admitted inciting racial hatred when he appeared briefly at Swansea Magistrates' Court and today he was jailed for 56 days at the same court.

The first of Stacey's messages began with "LOL [laugh out loud]. Muamba. He's dead!!!"

A number of people took him to task for his views and he responded with a further string of offensive and racist comments aimed at other Twitter users.

Stacey was close to tears during his appearance before magistrates last week.

In jailing Stacey today, the judge said he took into account his early plea and the fact that he had been "in drink" at the time.

Stacey's sentence prompted a heated debate on Twitter.

Among those applauding the judge's decision was Lord Sugar, who tweeted: "good job, be warned idiots".

Others claimed the decision was too harsh given the student's previously clean criminal record.

But Jim Brisbane, Chief Crown Prosecutor for CPS Cymru-Wales, said racist language was 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.

District Judge John Charles told Stacey that his actions would do untold harm to his career.

He said that "It was racist abuse via a social networking site instigated as a result of a vile and abhorrent comment about a young footballer who was fighting for his life."

Other undergraduates at Swansea campaigned for him to be dismissed from the university completely.

The student remains suspended from the university pending the conclusion of our disciplinary proceedings.

He is still the subject of an internal investigation.