Azhar Ahmed, wrote on Facebook that "all soldiers should die and go to hell" following the death of six servicemen in Afghanistan. 20-year-old Ahmed, from Ravensthorpe in West Yorkshire said he did not think his comments were offensive.
District Judge Jane Goodwin disagreed, branding his remarks were "derogatory, disrespectful and inflammatory".
He will now do two hundred and forty hours of community service over a two year period and has been fined £300.
More top news
Linda Box pleaded guilty to nine counts of fraud, two of forgery and one of theft at a hearing at Leeds Crown Court today.
Emmie's mum shared now-poignant photos of their recent visit to London with ITV News as her daughter paid homage to the fallen officer.
The publication, called 'King of Clubs', is about the late founder and owner of Batley Variety Club, Jimmy Corrigan.