In Bonn, the word spread quickly around the garden party for 8,000 given by Chancellor Helmut Schmidt. Another head would turn, a frown would form on the lips and the message would be relayed: "Haig has quit." Then the heads began turning the other way, and smiles replaced grimaces as West German officials whispered to each other: "It's Shultz."

In Moscow, there was a hint of smugness in the announcement by the Soviet news agency Tass that Haig had been ousted because of "obvious discord" within the administration over Israel's assault on Beirut.

In the Middle East, there was a brief moment of hope among Arab nations that the change would mean that Washington would finally intervene and stop the Israeli blitzkrieg, and a statement of regret from the Israeli government about Alexander M. Haig Jr.'s abrupt departure as secretary of state.

"We may have won the war, but I don't know if we will get through the last battle," a Palestinian guerrilla told Washington Post correspondent Jonathan C. Randal in Beirut, referring to fears that Israeli Defense Minister Ariel Sharon will continue to press his campaign to destroy the Palestine Liberation Organization. "Like Sharon, Haig was a general who tried to hijack his country for political ambition and failed."

These were some of the initial foreign reactions that poured into Washington on Haig's stunning resignation and the naming of former treasury secretary George P. Shultz to replace him. European countries and Israel were clearly disconcerted by the loss of the man they felt had most strongly, and ably, argued their separate cases in an administration that has still to establish a record abroad of consistency and coherence.

But after an initial stock taking, Europeans were obviously relieved by the choice of Shultz, who is particularly well known in West Germany. Chancellor Schmidt, who ducked reporters at the reception where word was first received, has been Shultz's house guest in California, and the two developed particularly close relations through their work when Shultz was treasury secretary.

Foreign Minister Hans-Dietrich Genscher told Washington Post correspondent Bradley Graham in Bonn that West Germany had "no inkling" that the change was coming. Bonn "was saddened" by Haig's departure, Genscher added, but reassured by Shultz's arrival.

One of Schmidt's guests at the reception was Assistant Secretary of State for Europe Richard Burt, who paled when told the news by a Schmidt aide.

"Do you have a telephone I can use to call Washington?" asked Burt, who arrived Wednesday.

Shultz impressed French officials when he visited Paris before the seven-nation economic summit at Versailles earlier this month. His comments there were said to have displayed a strong grasp of all aspects of foreign policy, not just summit preparations. At first stunned by the departure of Haig, official Paris last night seemed to view Shultz's arrival as a positive sign.

European diplomats were curious about whether Shultz would pick up the hard anti-Soviet line that Haig has sounded in the Third World, but moderated when dealing with European problems such as the Soviet natural gas pipeline, a dispute that has soured U.S.-European relations.

"Well, well, surprise after surprise," Soviet Ambassador to the United Nations Oleg Troyanovsky said when asked for comment. The change comes four days before the United States and Soviet Union are due to commence Strategic Arms Reduction Talks (START) in Geneva. Haig had been a chief proponent of resuming arms control deliberations with the Russians.

In a dispatch from Washington, Tass said, "Apparently at the last moment, when President Reagan decided to give the green light to the Israeli assault on West Beirut, a move fraught with dangerous consequences for the cause of peace in the Middle East and the whole world, contradiction within the U.S. administration became further aggravated."

Israel's Foreign Ministry hailed Haig as "a great statesman and a loyal friend of Israel" and said that Israel deeply regretted the resignation. Israeli officials have made no secret of their fears that Haig would be bested in policy debates in Washington by Defense Secretary Caspar Weinberger, who like Shultz worked at Bechtel Corp. before coming to the Reagan administration. Bechtel has multibillion-dollar construction contracts in Saudi Arabia.

But Haig had clearly been winning the Middle East battles over the Israeli invasion of Lebanon, in which he repeatedly assured Reagan that it would be counterproductive to attempt to oppose the ever-expanding Israeli military onslaught with pressure or public statements. This role explains the relief Arab officials voiced yesterday at the change.

"Now maybe we will see a more balanced United States policy," former Lebanese prime minister Saeb Salam said in Beirut. Salam said Haig had sought harsh terms to force a surrender of the Palestinian guerrillas in Beirut.