JERUSALEM, JUNE 12 -- As the Israeli Knesset neared the end of the six-hour debate that preceded approval of a new government Monday night, Prime Minister Yitzhak Shamir returned to the rostrum and allowed himself a rare, broad grin at the expense of longtime rival and Labor Party leader Shimon Peres.

"I understand him, that this is a sad day for him," Shamir said wryly as he gazed down at Peres. "He wantedto see himself today in my situation, as the one forming the coalition. But that's what happens in the political battle. One person wins, and one loses."

Behind that taunt lay another display of tactical mastery by a prime minister who, in nearly five years on the job, has outmaneuvered political rivals as skillfully as he has eluded political definition. Seemingly cornered three months ago by a combination of U.S. diplomatic pressure, challenges from hard-liners in his Likud Party and Peres's drive to replace him, Shamir has emerged from Israel's political crisis once again on top, proving anew that charisma and ideology are no match for deftness in this country's politics.

As the 74-year-old Shamir inaugurates his fourth cabinet, he has come to be widely regarded here as a leader for whom defensive maneuvering is an act of policy as well as a talent. Despite his right-wing political convictions, the record suggests that the aim of the enigmatic former spymaster has invariably been to perserve the status quo. "Shamir feels that Israel has been through enough crises and traumas for one century," said Nachum Barnea, a political columnist. "His goal is to prevent anything more from happening."

Still, one effect of the long leadership crisis has been to eliminate much of the political middle ground on which past Shamir-led governments have rested. To survive as prime minister, Shamir was forced not only to end the "unity coalition" with Labor but to promote several of his most bitter rivals in Likud into powerful new positions. These ambitious hard-liners and the far-right politicians now enlisted in the government will quickly grow restless if the new administration, like Shamir cabinets of the past, seems to be treading water.

Moreover, the exigencies of coalition building have forced Shamir into steps that seem sure to exacerbate already tense relations with the United States, thus increasing pressure on Israel. At a time when the United States and the Soviet Union are worried about the settlement of Soviet Jews in the Israeli-occupied West Bank and Gaza Strip, Israel's housing minister and chief of immigrant absorption will be Ariel Sharon, the hard-line former defense minister who is one of the strongest advocates of the settlements.

To sort out relations with Washington, Shamir will have to rely on David Levy, another erstwhile political rival who has opposed recent U.S. Middle East diplomacy and who supervised the most criticized Israeli action of the year, the government-funded move by Jewish settlers into Jerusalem's Christian Quarter. Although much business between Jerusalem and Washington in the past has been conducted by telephone, Levy does not speak English.

Similarly awkward appointments crowd the new cabinet list. The Ministry of Communications, which is charged with supervising a new state television station as well as cable systems, has been assigned to a politician from the ultra-Orthodox religious party Shas who owns no television set.

"You can see that the demands of internal political balance in the government totally outweigh what would be fruitful for Israel vis-a-vis the world or the issues," said Yaron Ezrachi, a liberal political scientist at Hebrew University. "The capacity of this government to respond to external challenges will be very limited."

Even the most sympathetic political observers here are doubtful that the new administration will be capable of moving toward the Israeli-Palestinian talks that the United States and Egypt see as the crucial next step in any Middle East peace process.

"This government's major challenge will be establishing credibility in foreign affairs," said Harry Wall, director in Israel of the Anti-Discrimination League of B'nai B'rith. "It will have to exert itself more than the previous one on the peace process, if for no other reason than to prove that it's not intransigent."

While liberals say that immobility on the peace front could be dangerous for Israel, they are quietly hopeful that the same disability could affect any government move to expand settlements in the occupied territories or crack down on rebellious Palestinians living in them. Although Shamir and his chief political ally, Defense Minister Moshe Arens, do not in principle oppose such steps, they are also eager to thwart the personal ambitions of Sharon and other rightists who advocate them.

In that sense, the most significant result of a government whose maximum life expectancy is 2 1/2 years may be to resolve a power struggle over the future of Likud. In the seven years it has been led by Shamir, a party that once was little more than the personal organ of former prime minister Menachem Begin has begun to modernize and drift toward the political center, guided largely by a new generation of well-educated, technocratic politicians like Arens.

In opposition to this trend stand Sharon and Levy, both ambitious men with populist styles who would like to dominate Likud as Begin did. Both hope to use the new government to position themselves as Shamir's successor.

"Whether the new government lives out its days or not," said political reporter Ilan Shehori of the influential newspaper Haaretz, "the power struggle in Likud has already begun."