In the wake of Mrs Maguire's death, Robert Riley told his followers he would not just have killed Mrs Maguire but "all the bastard teachers" at Corpus Christi School in Leeds.
The jobless 42-year-old from Cwmavon, Port Talbot, also said Nazi death camp Auschwitz was a "health spa" and suggested Muslim babies should be drowned.
Riley, an ex-drug addictwho used the Twitter handle @johnriley001, pleaded guilty to one charge of sending a grossly offensive message via a public communications network when he appeared before Swansea magistrates yesterday.
Chairwoman of the bench Georgina Scannell said she was left with no choice but to send the defendant straight to jail. She said: "The offensive messages outraged the public. You had complete disregard for the tragic death of Ann Maguire."
Mrs Maguire was stabbed while teaching a lesson at her school on April 28.