GAZA CITY — It was a striking tableau: Ismail Haniya, the political leader of Hamas, the Islamic militant group that has tried suicide bombs, rockets and attack tunnels in its long struggle with Israel, standing before portraits of the giants of nonviolent resistance — Mahatma Gandhi, the Rev. Dr. Martin Luther King Jr. and Nelson Mandela.

Urging on Palestinians who have staged a new campaign of protests along the fence separating Gaza from Israel, Mr. Haniya likened their struggle to those for India’s independence, against racial segregation and discrimination in the United States, and against apartheid in South Africa.

“This blessed protest is national, peaceful, popular and civilized,” he said.

Minutes later, though, he called the same protests “a deadly weapon” with which to achieve the Palestinians’ goals, saying that guns, rockets and attack tunnels — the more familiar weapons that have kept Hamas listed as a terrorist group by the United States, European Union and Israel — remained at hand if needed.

Mixed messages have abounded during the so-called Great Return March, the grass-roots campaign that is now in its third week and seeks to highlight hardship in Gaza and demand the right to return to lands in Israel. While organizers promised peaceful disobedience of Israel’s orders to stay far from the fence, participants have thrown Molotov cocktails and other explosives, even attaching one to a kite.