Spain will establish formal diplomatic relations with Israel Friday at a ceremony involving officials of both countries that will be held at The Hague, a spokesman for Prime Minister Felipe Gonzalez said tonight.

The long-awaited move ends an anomaly in Spain's foreign relations, as the Madrid government was the sole member of the western bloc to shun Israel at an official level.

The spokesman said Gonzalez would travel to The Hague Sunday for a meeting with Israeli Prime Minister Shimon Peres, who is due to arrive that day in the Netherlands for a European tour.

The Dutch government, which holds the presidency of the European Community, will act as host for the meeting between Gonzalez and Peres as well as for Friday's official diplomatic encounter at which instruments of recognition will be exchanged.

Spain is expected to balance its move with a statement repeating its continued support for a just and peaceful solution of the Palestinian problem.

Officials in Madrid have been studying a series of gestures, which could include an upgrading in the status of the Palestine Liberation Organization, which for several years has maintained a representative office in the Spanish capital.

In addition, Spain is expected to locate its future embassy in Israel in Tel Aviv, rather than Jerusalem.

Despite such mitigating moves, Spain has braced itself for an Arab backlash. Severe security measures at Spanish airports, which included the presence of troops, underlined fears of terrorist attacks following the establishment of relations with Israel.

Officials said members of Spain's elite antiterrorist police unit had been sent to Spanish diplomatic missions in Arab countries to strengthen security.

The Madrid government has been the object of uniformly unfavorable comment in several Arab newspapers in recent days following a meeting here last week between Foreign Minister Francisco Fernandez Ordonez and Arab envoys accredited to Spain.

At that meeting, the foreign minister gave notice of the government's recognition plans, saying that there would be an exchange of ambassadors with Israel within "six months," according to diplomatic sources.

In a simultaneous move, Spanish Defense Minister Narcis Erra traveled to Cairo to tell President Hosni Mubarak of Madrid's plans.

Echoing a widespread view in the Arab media, the Tunisian newspaper La Presse termed Madrid's impending diplomatic move a "betrayal" of Spain's traditional policy of friendship with the Arab world.

There also were fears in Madrid of retaliatory action by Arab petroleum producers, particularly by Libya, which provides 9 percent of Spain's oil imports.

The decision to recognize Israel draws the curtain, however, on an increasingly embarrassing problem that is essentially a historical leftover of the dictatorship of Francisco Franco that ended in 1975.

In 1948, when the state of Israel was created, Tel Aviv refused to recognize Franco's Spain because of the dictator's links with the Axis powers during World War II. Evidence now indicates Franco turned a blind eye to Jews who escaped Nazi-occupied France via Spain.