The Defence Department has charged and reprimanded two serving soldiers involved in making violent and racist comments in the wake of last month's Islamic protests in Sydney.

Thirteen other soldiers have been formally counselled over their actions.

Defence launched an investigation after a group of Australian soldiers from the Townsville-based 3rd Brigade made threatening comments against the Muslim community on Facebook.

Those involved joked about using sniper rifles and machine guns on Muslims.

The remarks were made in the days after the Sydney protest sparked by an anti-Islamic film insulting the Prophet Mohammed.

These were some of the comments left on the Facebook page:

Defence says two soldiers have been charged under the Defence Force Discipline Act and were formally reprimanded.

Disciplinary action is pending against one other soldier.

The Islamic community has welcomed the action.

Ahmed Kilani, who runs the Muslim Village website, says he is satisfied with the outcome:

"I think it sends out a strong message that we need to stamp out this type of mentality in the Defence Force or elsewhere in society," he said.

Khaled Sukkarrieh from the New South Wales Islamic Council says he hopes other soldiers take note.