Four soldiers have been sentenced to 10 days in military prison after posting pictures of themselves on Facebook demanding revenge for the murder of the three kidnapped teenagers in the West Bank.

“This is a grave incident that is inconsistent with what is expected of soldiers in the Israel Defense Forces,” the IDF Spokesman’s Office said in a statement. “Any such incident that commanders learn of will be treated with the utmost severity.”

The soldiers are Nahal Haredi troops — ultra-Orthodox Jews who combine military service with the establishment of agricultural communities. At least a few dozen soldiers took part in the Facebook protest.

Dozens of groups calling for revenge have been launched on social media; some of them, such as the People of Israel Demand Revenge, have received tens of thousands of likes. Civilians too have posted pictures of themselves calling for revenge.

The Justice Ministry said the police would investigate the “publication of incitement to violence and racism” on the Internet, at the request of Attorney General Yehuda Weinstein and State Prosecutor Shai Nitzan. The national cyber-crime unit would lead the investigation.

“The State Prosecutor’s Office and the police view such incitement extremely seriously, whether it is targeted at Jews or Arabs. A criminal investigation will be opened,” the Justice Ministry said.

The organization Honenu is providing legal aid to some of the 10 soldiers imprisoned. “The military is trying to deal with the Internet protest using the wrong incident; it is settling accounts with the wrong soldiers,” said attorney Adi Keidar of Honenu.

“What the combat soldiers posted does not constitute a crime .... These are excellent troops. We call on the military authorities to immediately cancel the disciplinary procecure against them and return them to operational duty as soon as possible.”