The United States turned to the International Committee of the Red Cross (ICRC) in the first 24 hours after the hijacking of TWA Flight 847 to help arrange a staggered swap of the passengers for Shiite prisoners held in Israel, but a sudden decision by the hijackers to leave Algiers foiled the plan, according to a source close to those negotiations.

"The plan from the beginning was a swap," the source said. "The United States asked the ICRC to go to Algiers to arrange the swap but they didn't want to make it public."

This suggests that the administration initially had devised a two-track strategy of simultaneously trying to arrange a swap behind the scenes while publicly taking a hard line against making any "deal" or "concessions" with the hijackers over the release of the TWA passengers.

Yesterday, one U.S. official confirmed the existence of such a swap plan but quickly added, "that was when we thought it could be done in Algeria."

A White House official, when asked whether the United States was still engaged in a two-track policy, replied, "We're not engaged in that and wouldn't encourage that."

National security affairs adviser Robert C. McFarlane said yesterday: "We have not asked and will not ask the International Red Cross to take a negotiating role in any sense."

In Geneva yesterday, ICRC spokesman Jean-Jacques Kurz confirmed that the United States had asked the Red Cross to contact Israel about its plans for releasing its more than 700 Shiite prisoners. He did not indicate when the request had come but said, "We have had this request from the United States to approach the Israelis."

Kurz said the Red Cross had no plans to approach Israeli officials immediately, saying "it is up to them to decide whether they want to approach us."

"For the time being, we are not negotiating, not mediating. But if a decision is made by others . . . we are ready to help put it into practice."

ICRC President Alexander Hay is scheduled to hold a news conference in Washington this morning, and to meet later with President Reagan for what is officially described only as a photo opportunity.

The initial U.S. idea, according to the source close to the Algiers talks, was to persuade the hijackers to free all of Flight 847's passengers in Algiers while the ICRC contacted Israeli authorities about their already-announced intentions to release the Shiites from Lebanon they were holding.

The U.S. hoped the hijackers would accept the release of TWA hostages in Algiers "on the basis of a subsequent release" of the Shiite prisoners, the source said.

The administration apparently turned initially to the ICRC for help because of its past role in helping to arrange prisoner swaps between Israel and various Palestinian guerrilla groups.

Algerian officials who were also parties to the negotiations with the hijackers reportedly had asked them to accept the staggered swap solution, and thought that a deal was in the making. The hijackers indicated early on that they had great trust in Algeria because of its record as a Third World revolutionary country.

Then, for reasons still not clear, the hijackers forced the plane to leave Algiers Sunday morning, shortly before the deadline they themselves had set for the Israelis to agree to release their Shiite prisoners.

"They feared a military operation in Algiers and took off," the source said.

American television networks had begun reporting Friday evening that the U.S. Army had dispatched its "Delta Force" antiterrorist squad to the Middle East.

The U.S. government had pressured the Algerian government to try to prevent the plane from leaving Algiers, but the Algerians had decided they would not use force, such as shooting out the jet's wheels, to stop its departure.

"We very much wanted that plane to stay in Algeria," one U.S. official said.

Until the sudden departure of the aircraft, negotiations between Algerian and ICRC officials and the hijackers, by then numbering 10 to 12, had been going fairly well, the source said.

The Algerians had persuaded the hijackers to reduce their demands to release of the Shiite prisoners in Israel.

In addition, the hijackers had released nearly 80 passengers to Algerian authorities and had become more relaxed generally, according to this source.

Hopes for arranging any kind of swap, in his judgment, were upset by two events. The first was the hijackers' unexpected and sudden decision to return to Beirut early Sunday morning.

The second was the Israeli government announcement Sunday that it would not consider a swap without a formal request from the U.S. government.

Reagan may have hinted at the failure of this first diplomatic initiative when he returned to the White House from Camp David last Sunday morning, ahead of his previous schedule.

Asked why he had returned then, Reagan told reporters that he decided to come back to Washington after the plane left Algiers for Beirut that morning.