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
The forecast for Monday night into Tuesday morning from Jon Mitchell.
Parents of an 8-year-old who has a rare and incurable genetic disease, have started a campaign for a new treatment on the NHS.
Three men who held staff at gunpoint at Berry's in Albion Street and stole more than 150 watches have been jailed for more than 51 years.