Yitzhak Shamir, who emerged from the militant wing of a Jewish militia and served as Israel’s prime minister longer than anyone but David Ben-Gurion, promoting a muscular Zionism and expansive settlement in the occupied West Bank and Gaza Strip, died Saturday at a nursing home in Tel Aviv. He was 96.


Mr. Shamir had Alzheimer’s disease for at least the last six years, an associate said. His death was announced by the prime minister’s office.


A native of Poland whose family was wiped out in the Holocaust, Mr. Shamir was part of a group of right-wing Israeli politicians led by Menachem Begin who rose to power in the 1970s as the more left-wing Labor Party declined, viewed as corrupt and disdainful of the public.


Stubborn and laconic, Mr. Shamir was by his own assessment a most unlikely political leader whose very personality seemed the perfect representation of his government’s policy of patient, determined, unyielding opposition to territorial concessions.


Many of his friends and colleagues ascribed his character to his years in the underground in the 1940s, when he sent Jewish fighters out to kill British officers whom he saw as occupiers. He was a wanted man then; to the British rulers of the Palestine mandate he was a terrorist, an assassin. He appeared in public only at night, disguised as a Hasidic rabbi. But Mr. Shamir said he considered those “the best years of my life.”


His wife, Shulamit, once said that in the underground she and her husband had learned not to talk about their work for fear of being overheard. It was a habit he apparently never lost.


Mr. Shamir was not blessed with a sharp wit, a soothing public manner or an engaging oratorical style. Most often he answered questions with a shrug and an air of weary wisdom, as if to say: “This is so clear. Why do you even ask?”


In 1988, at a meeting of the political party Herut, he sat slumped on a sofa, gazing at the floor as party stalwarts heaped praises on him. Shortly thereafter, he said: “I like all those people, they’re nice people. But this is not my style, not my language. This kind of meeting is the modern picture, but I don’t belong to it.”


Rather than bend to them, Mr. Shamir often simply outlasted his political opponents, who were usually much more willing to say what was on their minds, and sometimes to get in trouble for it. To Mr. Shamir, victory came not from compromise, but from strength, patience and cunning.


“If he wants something, it may take a long time, but he’ll never let go,” Avi Pazner, his media adviser, once remarked.


In a statement on Saturday, Prime Minister Benjamin Netanyahu said that Mr. Shamir “belonged to the generation of giants who founded the State of Israel and fought for the freedom of the Jewish people.”


“As prime minister,” he added, “Yitzhak Shamir took action to fortify Israel’s security and ensure its future.”


Prime Minister Begin appointed Mr. Shamir as foreign minister in 1980. When Mr. Begin suddenly retired in 1983, Mr. Shamir became a compromise candidate to replace him, alternating in the post with Shimon Peres for one four-year term. Mr. Shamir won his own term in 1988. He entered the political opposition when Yitzhak Rabin of the Labor Party was elected prime minister in 1992. Mr. Shamir retired from politics a few years later, at 81.


A Hard-Line Approach


As prime minister, Mr. Shamir promoted continued Jewish settlement in the West Bank and the Gaza Strip, which Israel conquered in 1967; the Jewish population in the occupied territories increased by nearly 30 percent while he was in office. He also encouraged the immigration of tens of thousands of Soviet Jews to Israel, an influx that changed the country’s demographic character.


One of the most notable events during his tenure was the Palestinian uprising against Israeli control that began in December 1987, the so-called intifada. He and his defense minister, Mr. Rabin, deployed thousands of Israeli troops throughout the occupied territories to quash the rebellion. They failed; the years of violence and death on both sides brought criticism and condemnation from around the world.


The fighting also deepened divisions between Israel’s two political camps: leftists who believed in making concessions to bring peace, and members of the right who believed, as Mr. Shamir once put it, that “Israel’s days without Jerusalem, Judea and Samaria and the Gaza Strip are gone and will not return.”