Japanese Red Army guerrillas early today released 50 of 139 hostages held on a hijacked jet for four days in exchange for millions of dollars in ransom and freedom of six guerrillas flown from jails in Japan.

It appeared the five hijackes, who had originally agreed to release 58 of those remaining abroad, had decided to limit the number and to keep abroad a total of 83 hostages, including 14 crew members.

The hijackers insisted on keeping the remaining hostages abroad the Japanese Air Lines DC-8 because they said, authorities might attempt to shoot down the plane if they were in it alone.

Most of the first group of hostages freed were Japanese women passengers. They said they had been treated "quite nicely."

American hostage John Gabriel, who had faced a 10-minute execution deadline as the terrorists bargained with Japanese and Bangladesh officials, suffered an apparent heart attack and was freed teh prisoner exchange.

Doctor at Holy Family Hospital here at first said Gabriel, a California bank president, was in critical condition. But U.S. embassy spokesman later reported that he was greately improved.

After the terrorists released Gabriel they still held 139 passengers and crew members hostage abroad their captive Japan Air Lines DC-8 jet. They then struck a bargin with officials on the ground and agreed to free 58 more hostages in return for the $6 million ransom in U.S. currency and delivery of the six freed prisoners.

The swap of hostages for Japanese prisoners and ransom money proceedd slowly, and after more than two hours only 30 hostages had been freed. Each group of 10 hostages was traded for one prisoner delivered from Japan, and three of the prisoners carried $2 million payments withthem.

The area of the airport where the prisoner-hostage trade took place was dark and out of the view of reporters.

Interpreters said "all of the Japanese women released" reported there were six hijackers aboard the plane - five men and one "foreign woman." All earlier reports had said there were only five Red Army terrorists aboard.

The hijackers, who were described as about 30 or younger, insisted that they would keep 81 hostages onboard because "we must get where we are going."

The terrorists, who were armed with pistols, grenades and plastic explosives, radioed to the airport tower, declaring: "It is very dangerous. We have imperialists and zionist enemies. They could shoot down cur plane and crew.

"They can't shoot us down if our passengers are on board," the hijackers said. While the terrorists kep their destination a mystery Foreign Ministry sources in Tokyo said earlier the hijackers wanted to go to "a small, distant, revolutionary state which is friendly to us," possibly Libya or South Yemen. There was no indication whether any government was willing to accept them.

The threat to kill Gabriel came during an episode in which the hijackers revved up the plane's engines and steered it across the airport toward a second Jal DC-8 holding the ransom and freed prisoners.

Apparently angered at Bangladesh and Japanese negotiators' insistence that every hostage be released, the terrorist announced over their radio. "In 10 minutes we will Shoot Gabriel." Then they stopped broadcasting and moved their craft to a takeoff position less than 150 yards from the relief plane.

The hijackers fired two warning shots to keep security personel away. Bangladesh authorities ordered a convoy of firetrucks, jeeps, buses and cars to form a barrier between the two four-engine jets.

"Don't blow up the plane." Bangladesh Air Vice Marshal Abdul Gaffur Mahmood begged the hijackers.

The hijacked plane sat at the takeoff position for an uneasy two hours, then returned to parking spot on a taxiway several hundred yards away.

"We had no intention of letting the plane go away without finalizing the negotiations," Bangladesh Foreign Secretary Tabarak Husain told reporters.

"To the end we are trying to avoid bloodshed."

Japanese officials flown in on the relief plane that brought the prisoners and ransom had tried to get "more favorable" terms - the release of all hostages, not just the 58 persons designated by the terrorists. They subsequently capitulated to the hijackers' original demands.

The hijackers signed the craft during its Paris-to-Tokyo flight Wednesday morning after it left Bombay, India. Thursday and yesterday before Gabriel became ill today and the prisoners swap began.