An airplane hijacking that began four days ago when a Somali Army capitain shot his way into the cockpit of a jet bound for Saudi Arabia came to an elaborately staged conclusion here today at Addis Ababa airport.

With the government of Ethiopia as choreographer, the Somali Army captain and two of his fellow hijackers were permitted to conduct a press conference in which they denied being terrorists and denounced the government of Somalia. They were then granted political asylum and, as guests of the Ethiopian government, were taken away to a resort town southeast of Addis Ababa.

The hijacking of the Somali Airlines Boeing 707 that held more than 100 people in fear for their lives for nearly 75 hours came to this end, at least in part because it was expedient for Ethiopia in its long-running feud with Somalia.

The people of Ethiopia and Somalia, two neighbors on the Horn of Africa and two of the world's poorest countries, have been fighting each other for centuries. Having fought a full-scale war in 1977, both governments now support rebel groups that conduct periodic raids in each other's territory.

The end to Ethiopia's first air hijacking began early this morning when a multinational pack of journalists -- here to cover Ethiopia's severe famine but who have been sidetracked by the hijacking since Saturday -- were summoned to the airport by Ethiopia's Minister of Foreign Affairs Gushu Wolde.

"The drama has come to an end and happily," Gushu told reporters. "Everybody is free now, the crew, the hijackers and so on."

The foreign minister said that the Somali government had agreed to Army Capt. Awil Adan Bourhan's primary demand -- that seven Somali students who had been sentenced to death for political activities not be executed. As part of the deal, the minister said the passengers would be released immediately, the hijackers would be given political asylum and they would be allowed to hold a press conference.

But the passengers -- several of whom later said they spent four days fearing that the hijackers would blow up the plane with explosives they had brought on board -- were not released immediately. First came the hijackers' press conference.

The foreign minister, after calling Somalia an "oppressive country" and saying it was not helpful in resolving the hijacking, walked out of an airport waiting room where he had been talking to reporters. Minutes later, the Somali captain walked in, accompanied by two of his colleagues in the hijacking. The two were believed to be enlisted members of the Somali military. However, they wore civilian clothes.

"We are not terrorists," Awil said. He said the hijackers acted only to "save our brothers." The captain, whose khaki uniform appeared remarkably well pressed in spite of four days inside the plane, said he deliberately had chosen to hijack a plane carrying many Somali government officials. On board the flight, which originated in Mogadishu, the Somali capital, were government delegations bound for Cairo and Peking, along with the district governor of a province in northwest Somalia.

Referring to the district governor, the captain said, "When we are hijacking the airplane . . . he was afraid, too, and he cried. But we told him we cannot kill."

The captain was cut off when Ethiopian officials announced that the press conference was over. They then herded journalists onto a bus for a 400-yard trip out to look at the hijacked plane. Although the danger had passed, the blue-and- white jet still was surrounded by three armored personnel carriers and a score of Ethiopian soldiers. Many of the soldiers, all of them wearing camouflage khakis, red berets and carrying Russian-made AK47 automatic rifles stood in the waist-high grass that surrounds the runway.

Only after television cameras had been set up were the passengers and crew allowed to leave the plane. The hijackers had allowed 22 passengers, most of them women and children, off the plane earlier. It was not clear how many of the 130 persons originally aboard the plane had participated in the hijacking.

The passengers and crew, who had been confined to the plane for four days, emerged looking exhausted and relieved.

The one American on board, Navy Lt. Jim Dell, 30, who is stationed at Berbera, Somalia, yelled to reporters that he had been treated well on the plane. Later, however, in a brief interview permitted by the Ethiopian government, he indicated that throughout the hijacking he had been afraid that he would be killed.

Chief flight attendant Suad Mohammed gave the most complete account of the hijacking. She said it began about 30 minutes after takeoff when the Somali captain got out of his seat carrying a pistol and ran toward the plane's cockpit. She said she tried to wrestle the gun away.

"I grabbed him," said the slight, 26-year-old woman, "but he was too heavy, too strong . . . . He shot through [the cockpit's] closed door."

One member of the flight crew was wounded by a gunshot but not seriously. The plane's captain was beaten. The three hijackers -- later joined by at least one Somali passenger on the plane -- were denied permission to land in Aden, South Yemen, and landed in Addis Ababa Saturday morning.