A man who posted a Facebook message that said "all soldiers should die and go to hell" after six British soldiers were killed in Afghanistan was today spared jail.
Azhar Ahmed, 20, admitted posting the message two days after the deaths of the servicemen in March.
He was charged after the mother of one of the soldiers read the comments and was so upset she called the police.
Five of the dead soldiers were from the Warminster-based 3rd Battalion the Yorkshire Regiment.
Ahmed told a trial at Huddersfield Magistrates' Court he did not think what he had written was offensive.
But the remarks were described as "derogatory, disrespectful and inflammatory" by a district judge who found him guilty of sending a grossly offensive communication.
Sergeant Nigel Coupe, 33, of 1st Battalion The Duke of Lancaster's Regiment, was killed alongside Corporal Jake Hartley, 20, Private Anthony Frampton, 20, Private Christopher Kershaw, 19, Private Daniel Wade, 20, and Private Daniel Wilford, 21, all of 3rd Battalion the Yorkshire Regiment.
Ahmed's message said: "People gassin about the deaths of Soldiers! What about the innocent familys who have been brutally killed."
Ahmed, from West Yorkshire, told the court at his trial last month that he deleted the post as soon as he realised what reaction it was having.
He said he replied with apologies to many people who commented on his page and when some told him they had lost relatives in Afghanistan he realised how serious it was.
But he denied the message was grossly offensive and said he thought it would just have been upsetting and caused distress.
The trial heard that the parents of one of the six soldiers who died in the incident saw the posting, which was copied around the internet.
During today's sentencing at Huddersfield Magistrates' Court, Nicholas Barker, defending Ahmed, said it was a "serious matter" but not one that warranted custody.
He said Ahmed was initially voicing "legitimate concerns" about the victims of war but went on to overstep the mark.
When he realised his latter comments were causing distress, he removed them, Mr Barker added.
District Judge Jane Goodwin said the law should not stop legitimate political opinions being strongly voiced.
But she said the test was whether what was written was "beyond the pale of what's tolerable in our society".
She ruled Ahmed's posting was not tolerable and said "I'm satisfied that the message was grossly offensive".
He was given a two-year community order with 240 hours of community service and ordered to pay £300 in costs at today's hearing.