A man with links to far-right extremists sent a Jewish MP an image of a Holocaust yellow star printed on her forehead.
Luciana Berger, the Labour MP for Liverpool Wavertree, said she was left "deeply shocked" after receiving the image on Twitter from Garron Helm.
He was jailed for four weeks at Liverpool Magistrates Court, as a new law clamping down on web trolls was unveiled by the government.
Helm, 21, tweeted the image of a yellow star on Berger's head and accompanied it with the hashtag 'hitler was right' and the message: "You can always count on a Jew to show their true colours eventually."
The court heard Helm had links to a fringe group called National Action. His defence lawyer called him "immature" and said he forged links with the extremist group because he was lonely.
Judge Andrew Shaw said: "You positioned a Star of David over the head of a picture of the victim. The indirect character of the communication only served to cause potential humiliation by canvassing what you wrote to others first."
Berger issued a later statement after Helm was jailed. "This sentence sends a clear message that hate crime is not tolerated in our country," she said. "I hope this case serves as an encouragement to others to report hate crime whenever it rears its ugly head".
Web users who send and post abuse online face up to two years in prison, Justice Secretary Chris Grayling has announced. He said the new law shall target "crude and degrading" content and branded creators "cowards."