IN the summer of 2006, at a moment when Hezbollah rockets were falling virtually without pause on northern Israel, Nizar Rayyan, husband of four, father of 12, scholar of Islam and unblushing executioner, confessed to me one of his frustrations.
We were meeting in a concrete mosque in the Jabalya refugee camp in northern Gaza. Mr. Rayyan, who was a member of the Hamas ruling elite, and an important recruiter of suicide bombers until Israel killed him two weeks ago (along with several of his wives and children), arrived late to our meeting from parts unknown.
He was watchful for assassins even then, and when I asked him to describe his typical day, he suggested that I might be a spy for Fatah. Not the Mossad, mind you, not the C.I.A., but Fatah.
What a phantasmagorically strange conflict the Arab-Israeli war had become! Here was a Saudi-educated, anti-Shiite (but nevertheless Iranian-backed) Hamas theologian accusing a one-time Israeli Army prison official-turned-reporter of spying for Yasir Arafat's Fatah, an organization that had once been the foremost innovator of anti-Israeli terrorism but was now, in Mr. Rayyan's view, indefensibly, unforgivably moderate.
In the Palestinian civil war, Fatah, which today controls much of the West Bank and is engaged in intermittent negotiations with Israel, had become Mr. Rayyan's direst enemy, a party of apostates and quislings. "First we must deal with the Muslims who speak of a peace process and then we will deal with you," he declared.
But we spoke that day mainly about the hadith, the sayings of the Prophet Muhammad, that specifically concerned Jews and their diverse and apparently limitless character failings. This sort of conversation, while illuminating, can become wearying over time, at least for the Jewish participant, and so I was happy to learn that Mr. Rayyan had his own sore points.
"Hezbollah is doing very well against Israel, don't you think?" I asked. His face darkened, suggesting that he understood the implication of my question. At the time, Hamas, too, was firing rockets into Israel, though irregularly and without much effect.
"We support our brothers in the resistance," he said. But then he added, "I think each situation is different."
"They have advantages that we in Gaza don't have," he said. "They have excellent weapons. Hezbollah moves freely in Lebanon. We are trapped in the Israeli cage. So I don't like to hear the sentence, 'Hezbollah is the leader of the resistance.' It's a very annoying sentence. They are heroes to us. But we are the ones fighting in Palestine."
"And they're Shia," I said. Mr. Rayyan, who was educated by Wahhabi clerics in Saudi Arabia, was known in Gaza as a firm defender of Sunni theology and privilege, and sometimes lectured at the Islamic University of Gaza on the danger of Shiite "infiltration."
"Yes! There are many different secret agendas," he said. "We have to be aware of this."
Hamas men across Gaza were of two minds on the subject of Hezbollah: One night, I met the members of a Hamas rocket team in the town of Beit Hanoun, on Gaza's northern border with Israel. The group's leader, who went by the name of Abu Obeidah, said that he, too, was frustrated by Hezbollah's success against Israel; he even asked if Hamas's rocket attacks that summer were featured on television in America, and seemed to deflate physically when I told him no.
"Everyone, all the media, says that Hezbollah is wonderful," he complained. "We stand with our brothers of Hezbollah, of course, but, really, look at the advantages they have. They get all the rockets they will ever need from Iran."
Hamas is not a monolith, and opinions inside the group differ about many things, including engagement with the Shiites of Hezbollah and Iran. The former Hamas leader Abdel Aziz Rantisi told me shortly before he was assassinated by Israel in 2004 that it would be "uncharitable" to find fault with Iran.
"What do the Arab states do for us?" he asked. "Iran is steadfast against the Jews."
Today, there is no doubt that Rantisi's view holds sway inside the organization, and many in Hamas wish for even closer ties with Tehran, particularly over the past month as they have absorbed a battering from Israel. Even those who believe that Iran is secretly trying to bring Sunni Palestinians to Shiism acknowledge anti-Israel Shiites as ideals of resistance.
As the Gaza war moves to a cease-fire, a crucial question will inevitably arise, as it has before: Should Israel (and by extension, the United States) try to engage Hamas in a substantive and sustained manner?
It is a fair question, one worth debating, but it is unmoored from certain political and theological realities. One irresistible reality grows from Hamas's complicated, competitive relationship with Hezbollah. For Hamas, Hezbollah is not only a source of weapons and instruction, it is a mentor and role model.
Hamas's desire to best Hezbollah's achievements is natural, of course, but, more to the point, it is radicalizing. One of the reasons, among many, that Hamas felt compelled to break its cease-fire with Israel last month was to prove its potency to Muslims impressed with Hezbollah.
Another reality worth considering concerns theology. Hamas and Hezbollah emerged from very different streams of Islam: Hamas is the Palestinian branch of the Sunni Muslim Brotherhood; Hezbollah is an outright Iranian proxy that takes its inspiration from the radical Shiite politics of Ayatollah Ruhollah Khomeini. But the groups share a common belief that Jews are a cosmological evil, enemies of Islam since Muhammad sought refuge in Medina.
Periodically, advocates of negotiation suggest that the hostility toward Jews expressed by Hamas is somehow mutable. But in years of listening, I haven't heard much to suggest that its anti-Semitism is insincere. Like Hezbollah, Hamas believes that God is opposed to a Jewish state in Palestine. Both groups are rhetorically pitiless, though, again, Hamas sometimes appears to follow the lead of Hezbollah.
I once asked Abdel Aziz Rantisi where he learned what he called "the truth" of the Holocaust — that it didn't happen — and he referred me to books published by Hezbollah. Hamas and Hezbollah also share the view that the solution for Palestine lies in Europe. A spokesman for Hezbollah, Hassan Izzedine, once told me that the Jews who survive the Muslim "liberation" of Palestine "can go back to Germany, or wherever they came from." He went on to argue that the Jews are a "curse to anyone who lives near them."
Nizar Rayyan expressed much the same sentiment the night we spoke in 2006. We had been discussing a passage of the Koran that suggests that God turns a group of impious Jews into apes and pigs. The Hezbollah leader, Hassan Nasrallah, among others, has deployed this passage in his speeches. Once, at a rally in Beirut, he said: "We shout in the face of the killers of prophets and the descendants of the apes and pigs: We hope we will not see you next year. The shout remains, 'Death to Israel!'"
Mr. Rayyan said that, technically, Mr. Nasrallah was mistaken. "Allah changed disobedient Jews into apes and pigs, it is true, but he specifically said these apes and pigs did not have the ability to reproduce," Mr. Rayyan said. "So it is not literally true that Jews today are descended from pigs and apes, but it is true that some of the ancestors of Jews were transformed into pigs and apes, and it is true that Allah continually makes the Jews pay for their crimes in many different ways. They are a cursed people."
I asked him the question I always ask of Hamas leaders: Could you agree to anything more than a tactical cease-fire with Israel? I felt slightly ridiculous asking: A man who believes that God every now and again transforms Jews into pigs and apes might not be the most obvious candidate for peace talks at Camp David. Mr. Rayyan answered the question as I thought he would, saying that a long-term cease-fire would be unnecessary, because it will not take long for the forces of Islam to eradicate Israel.
There is a fixed idea among some Israeli leaders that Hamas can be bombed into moderation. This is a false and dangerous notion. It is true that Hamas can be deterred militarily for a time, but tanks cannot defeat deeply felt belief.
The reverse is also true: Hamas cannot be cajoled into moderation. Neither position credits Hamas with sincerity, or seriousness.
The only small chance for peace today is the same chance that existed before the Gaza invasion: The moderate Arab states, Europe, the United States and, mainly, Israel, must help Hamas's enemy, Fatah, prepare the West Bank for real freedom, and then hope that the people of Gaza, vast numbers of whom are unsympathetic to Hamas, see the West Bank as an alternative to the squalid vision of Hassan Nasrallah and Nizar Rayyan.