JERUSALEM, JAN. 24 -- Shlomo Avineri, a prominent Hebrew University political scientist close to Foreign Minister Shimon Peres, was recently discussing the six-weeks of Palestinian protest in the occupied West Bank and Gaza Strip when he raised a specter that sends shivers down the spines of many Israeli Jews.

Israel is strong enough militarily to hold on to the territories indefinitely despite Arab resistance, Avineri said. But if it chose to do so, he warned, "the next 15 years will look more like the last weeks . . . and by the year 2000 we will look into the mirror and we will see South Africa."

There are critics who claim that Avineri's vision of the future has come to pass already on the streets of Gaza. The rise of a new generation of angry young men challenging the might of an army with stones and bottles, the shootings and the beatings, the increasing restrictions on press coverage -- all of it, they contend, eerily echoes similar scenes in the black townships of South Africa.

So, too, does the image of a government that has resorted to a hard-line security stance to quell widespread civil disorder because it is unwilling, or unable, to take the risk of seeking a political solution.

Of all the charges leveled during the recent violence, none has stung the Israeli government more or produced more bitter reaction than the claim that Israel is becoming the South Africa of the Middle East. It is an analogy that, in the eyes of Israeli officials, not only equates this nation with a country that they find morally repugnant -- although they have had close ties with it in the past -- but also challenges the very right of the Jewish state to exist.

Israeli officials see the claim as part of a propaganda war waged by Israel's Arab enemies and abetted to some extent by the western news media. ABC News, for example, in two recent programs drew the comparison with film showing striking resemblances between scenes of fighting in South Africa and here and between the hard-line rhetoric of South African President Pieter W. Botha and that of Israeli Prime Minister Yitzhak Shamir.

The aim of such analogies, officials here contend, is to resurrect the concept first given voice in the 1975 U.N. General Assembly resolution equating Zionism with racism -- that Israel, like South Africa, is a pariah state outside the comity of nations and that it should be quarantined and delegitimized. Such isolation is especially feared here because, unlike South Africa, Israel is a small state, relatively bereft of natural resources and mineral wealth, that cannot stand alone.

"It's a disgusting and unfair comparison," said a senior Foreign Ministry official, "and there is more than a little anti-Semitism behind it. It's made by people who sit behind their desks in London and Washington smiling at our distress."

To help dispel the analogy, Israel last year cut back on longstanding close commercial and diplomatic ties with South Africa. More recently, the Foreign Ministry issued a confidential guidance paper to its embassies and consulates abroad outlining what it sees as the main differences between the two countries.

To assess the similarities and differences between South Africa and Israel is to step into a mine field of politics, history and emotion. "South Africa is a state of mind," said Israeli social scientist Meron Benvenisti, suggesting that the facts do not matter as much as the feeling that the two countries are becoming more alike.

Nonetheless, the question lingers, and it has become a topic of increasing controversy here. Among those drawn into the debate are government officials, academics and journalists -- including this reporter, who between 1983 and 1986 was The Washington Post's southern Africa correspondent.

Both nations came of age in 1948, when Israel gained its independence as a Jewish state and South Africa saw the triumph of Afrikaner nationalism in a watershed parliamentary election. But there, most Israelis argue, the similarities of history abruptly end.

While Jews were building a democratic state based on Zionist principles, the Afrikaners were constructing a system of white domination known as apartheid. It was a complete ideology, a total system that attempted to justify white-minority rule on economic, political, religious and even moral grounds.

South Africa's blacks were disenfranchised, confined to bleak rural homelands or overcrowded townships and ultimately denied citizenship in the land of their birth. Meanwhile, Israel's Arab minority had parliamentary representation and full civil rights, at least on paper. Arabic is an official language of the parliament, alongside Hebrew.

Then came June 1967 and Israel's triumph in the Six Day War, when it fought for its very existence after Syria, Iraq, Jordan and Saudi Arabia moved forces toward its border and Egypt sent thousands of troops into the Sinai. To maintain a crucial margin of security against future invasions, Israel occupied the West Bank and Gaza Strip with its 1.2 million Arab residents. It was to be temporary. But 20 years have passed, and Egypt is the only Arab country to have made peace with Israel. The occupation remained, and its Palestinian subjects have only the limited rights that military rule bestows.

The result, critics say, bears more than a surface resemblance to South Africa. Both governments operate under sweeping security regulations that give them broad powers against opponents far beyond those generally accepted in western democracies. Both nations maintain elaborate security police forces and networks of informers. Allegations of torture, secret files and other trappings of a police state can be found in both states despite the fact that they both boast a tradition of an independent judiciary.

"The lesson is that when one people controls another people, regardless of the reasons -- and our reasons are very different from those of the South Africans -- you end up doing the same things," said Dan Sagir, a journalist for the newspaper Haaretz who was based in South Africa until he was expelled by the Pretoria government in 1986.

Israelis argue that the reasons for the occupation -- the continuing state of war between Israel and the Arabs, the ongoing threat to Israel's survival -- explain and justify their actions in the occupied areas in ways that apartheid cannot be justified. South African blacks do not seek to destroy the state, the Israelis contend, but to become equal partners in it, and they have shown no desire to drive whites into the sea.

Palestinians, by contrast, do not want to become part of Israel but rather seek their own state, one that Israelis believe threatens Israel's existence and certainly its Jewish character.

But white Afrikaners argue that their survival, too, is under threat. Black rule, they contend, could destroy the country's economic system and mean the end of democracy for the whites who presently enjoy it. They say it also could mean cultural suicide for Afrikaners who fear that once they lose political control, they would forfeit control over institutions such as schools, churches and businesses.

Ultimately, for Afrikaners as well as Jews, it is their ethnic identity and their homeland that they believe is at stake. Neither will talk to his enemy -- Pretoria refuses to negotiate with the African National Congress, Jerusalem shuns the Palestine Liberation Organization.

Both employ the peoples they rule over as pools of cheap labor to do their most menial tasks. In Israel's case, Palestinian workers comprise only 6 percent its work force, whereas South Africa's entire economy is built upon the prevalence and use of black labor.

But as Jerusalem Post reporter Hirsh Goodman, himself a South African emigre, points out, the squalid black townships of South Africa were built by the white government to serve as reservoirs of cheap labor, whereas the equally squalid refugee camps of Gaza were constructed by Egypt and other Arab states unwilling to absorb the Palestinians who poured out of Israel in 1948.

Perhaps most important, Palestinians say they experience under occupation the same sense of powerlessness and humiliation that black South Africans must live with. "Any young soldier at a checkpoint from Ramallah to Jerusalem can order me to stop and humiliate me in front of my family," says Ibrahim Karaeen, owner of the Palestine Press Service, the pronationalist news agency based in East Jerusalem.

Now the unrest has created new similarities. As in South Africa, a new generation of disenfranchised Palestinians, believing that they lack any other means to express grievances and fulfill aspirations, disaffected with their old leaders, has taken to the streets in mass protest with a vehemence that has surprised their rulers and even their parents.

Tear gas has the same effect whether it is fired in Soweto or Gaza. But statistics suggest that Israel has a long way to go to catch up to South Africa in the ferocity of either the violence or the suppression of it.

According to the South African Institute of Race Relations, more than 2,300 persons died in South Africa in violence between September 1984 and February 1987 -- although many of these were blacks killed by other blacks. During one three-month period between March and June 1986, blacks were being killed at the rate of more than six per day. By contrast, the official death toll here is 38 Palestinians over a 45-day period -- fewer than one per day. Given the discrepancies in population, the death rates are not dissimilar, but the critical difference is that South Africa sustained a high rate for more than two years.

Pretoria detained nearly 12,000 people in 1985 and as many as 30,000 in 1986, according to figures from the government and the Detainees' Parents Support Committee. The committee says about 32,000 of the two-year total were arrested under emergency regulations and could be held without charge or trial for as long as the emergency continued.

By contrast, about 2,000 Palestinians have been arrested in the past 45 days, and most have either been released or tried and sentenced by military courts. Critics have mocked the trials as summary and unfair -- but at least the sentences that they hand out are of fixed duration.

There is also the contrast between the armies of the two nations. Both had trouble responding in early days to the unrest, and both found that a hard response provoked violent reactions while a soft response was seen by activists as weakness. But analysts say South African police units appeared better trained and better equipped to deal with rioters than Israeli soldiers.

After the early violence, South African police seldom patrolled on foot, moving instead in armored personnel carriers. By contrast, Israeli soldiers patrolled on foot in small units, refusing to wear helmets and often lacking antiriot gear. The financially strapped Israeli Army had chosen not to purchase water cannon and other sophisticated equipment. When trapped, soldiers sometimes felt they had little choice but to open fire with live ammunition.

Both governments have pursued a hard line in response to the violence, and both are led by stolid nationalists in their 70s. But there the political similarities end.

South Africa has been ruled for 40 years by the National Party, which maintains a massive majority in Parliament and suffocates dissent. There are debates and dissenting views within the ruling party, but the face that it shows to the outside world has but one determined expression.

Israel's government, on the other hand, is an uneasy coalition between Prime Minister Shamir's Likud and the more dovish Labor Party of Foreign Minister Peres. The political atmosphere here is loud, impulsive, untidy, disruptive, full of dissonance and dissension -- the tumultuous noise of a functional democracy, even critics concede.

Many here, such as Avineri and Benvenisti, fear for Israel's future. The violence, they say, is helping to solidify the Israeli right while causing turmoil in the Labor Party, whose ideology is much more fuzzy than that of the Likud. The end of the road could be the collapse of Labor and the triumph of the right similar to the collapse of the centrist Union Party in South Africa in the late 1940s and early 1950s.

At the same time, these academics contend, demographics are slowly but steadily leading to an Arab majority population in Israel proper and the territories combined. Israel ultimately will have to surrender the territories to maintain its Jewish character or else deny democracy to an Arab majority. The latter is seen as the "South Africa option."

It is a gloomy scenario and one not accepted by many here. They contend that Israel's essentially democratic character will assert itself and prevent an Israeli version of apartheid from gaining a foothold.

There was a time not long ago when Israeli officials greeted new arrivals from South Africa with a smile and noted that they had come from the one place that had more intractable problems than Israel itself faced.

But South Africa is a broad land with great wealth whose people share a birthright, though not a political vision. Israel has no such wealth to share among its fractious population and no clearcut solutions. And its officials are no longer smiling.