PARIS — The French far-right leader Marine Le Pen has been ordered to stand trial in a criminal case involving graphic photographs of acts of violence by the Islamic State that she posted on Twitter in 2015.

Ms. Le Pen, the head of the National Rally party, formerly known as the National Front, has been charged under an article in the French penal code that prohibits “disseminating” messages that are “violent” or that could “seriously harm human dignity” and that could be seen by a minor, according to the prosecutor’s office in Nanterre, a western suburb of Paris.

If found guilty, she could face a maximum sentence of three years in prison and a fine of 75,000 euros, or about $85,000. The prosecutor’s office said on Thursday that a date for the trial had not been set, but that it would be held in Nanterre.

In 2015, when a television journalist compared her party to the Islamic State, Ms. Le Pen reacted angrily by posting three pictures on Twitter that showed killings by the group, including one of the decapitated body of James Foley, an American journalist.