The Israeli government, threatened with damaging publicity and diplomatic retaliation abroad, acknowledged last night that it has been holding five terrorists in custody for more than a year.

Israel said it intends to try them in secret for attempting to shoot down an EI Al passenger plane outside Israel.

The terse Israeli announcement of the charges against the terorists - two West Germans and three Arabs - did not say where the attempted attack took place. West German officials in Bonn confirmed Israeli press reports that it happeded in Nairobi Kenya.

The disclosure of the secret confinement stirred criticism here and abroad today and was considered likely to cause considerable embarrassment to Kenya, one of Israel's few remaining friends in black Africa.

West Germany made an "emphatic protest" to Israel last night over the affair, a Foreign Ministry spokesman said in Bonn. West Germany was not informed until March 15 that the suspects had been in jail since January 1976, the spokesman said, adding that Bonn reserved the right to take further steps after studying the case.

Last night's announcement provided few details of the case and did not say how the five suspects had come into Israeli custody. The secrecy presumably stemmed from Israel's desire to cloak its war against international terrorism and its hope to avoid embarrassing Kenya.

Close cooperation between Kenya and Israel is an open secret but Kenya has never been eager to advertise the unofficial link for fear of criticism from the rest of black Africa which,like Kenya, served official with Israel at the time of the 1973 war. The cooperation became most visible in July when Kenya was used as a landing site for the Israel commando raid on Entebbe Airport in Uganda.

Among the demands the Entebbe hijackers made was that five terrorists be freed: three of them Arabs said to be held by Kenya and two of them West Germans held by West Germany. Both Kenya and West Germany denied holding the terrorists. Last night's announcement clears up one of the Entebbe mysteries for it is now clear that the Kenyans had already handed the five over to Israel.

Israel officials were under instructions today to say nothing beyond the official announcement, but from Israeli and foreign press accounts, as well as sources speaking not for attribution, it was possible to piece together a reasonably accurate if incomplete picture of the affair.

The announcement, made by Prime Minister Yitzhak Rabin's military secretary, Brig. Gen. Ephraim Poran, said the El Al plane was carrying more than 100 passengers and was about to land when the terrorists tried to shoot it down with "ground-to-air missiles." The terrorists were to be tried "in the near future" by a military court behind "closed doors," he said.

The incident took place at Nairobi in January 1976 when an El Al plane, enroute from Johannesburg to Tel Aviv, was about to land. The three Arabs were arrested by Kenyan security forces near the airport fense, armed with Soviet-made heat-seeking rockets. The two West Germans, accused of being accomplices, were arrested later.

Rather than risk reprisals, the Kenyan government apparently agreed to hand over the terrorists secretly to Israel passed a law in 1971 that allows trial in Israel of persons charged with attempting to harm Israeli citizens outside Israel.

The rockets allegedly came from neighboring Uganda and it seems likely that Kenyan and Israeli intelligence agencies cooperated in monitoring their preparations, enabling Kenya to arrest the terrorists before they could fir their missiles.

The apparent reason for Israel's abrupt announcement now was that the family of one of the West Germans was about to publish details of the case in West Germany, putting Israel in an unfavorable light, sources said.

The West Germans arrested were Brigitte Schultz, 23 and Thomas Reuter, 14. Bonn authorities were notified and their families informed only after the families had begun searching for them. West German embassy officials recently visisted with the two and the parents of Schultz have come to Israel.

The Israeli Foreign Ministry said tonight in response to the West German protest:

Israel points out with regret that the international community has so far failed to find an efficient way to combat the Palestinian terror organizations and their accomplices. This terror is directed against innocent revillians and the foiling of the attack against the El Al plane saved, the lives of more than 100 passengers.

"Israel finds herself in the front line of this war and she will continue to defend her air routes as in the past."

It is beleived here that the three Arabs were members of Wadia Haddad's Popular Revolutionary Front; a splinter group of Goerge Habash's Popular Front for the Liberation of Palestine. This group rejects at alltempts to negotiate with IsraeL.

The West Germans reportedly had been connected with the Baader-Meinhof gang, a West German terrorist group.

Wadia Haddad's organization, which has made a special effort to recruit foreigners, including the notorious Venezuelan terrorist known as "Carlos," is alos beleived to have Air France plane to Entebbe last July.

The January 1976 incident reportedly set the scene for the close cooperations between Kenya and Israel during the Entebbe raid, when Israel planes were allowed to land at Nairobi on their return to refiel and unload the most seriously wounded of the hostages.

Officially, Kenya has never admitted its part in the Entebbe raid or acknowledge that the attempted attack on the El Al jet ever took place. Today, a Kenyan Foreign Minister spokesman refused to comment on the incidents.

News of the attempt on the Israeli jet nevertheless spread qucikly in Jnauary 1976.

Since then, at least half a dozen brawny young security men have come to Nairobi and with Kenya's tough general service until they patrol the area around the airport whenever any of El Al's four weekly planes land in Nairobi. Kenya is the only country in black Africa that allows El Al to land and without Kenyan landing rights, it would be difficult for Israel to maintain its flights to South Africa, with whom it has close ties.

The Israel security men can be seen swimming at Nairobi's posh Parklands Sports Club, which now has the most, elaborate security system of Nairobi's exclusive clubs.

Last night the government-controlled Kenya news agency began distributing the story about the announcement in Israel. After several paragraphs the sotry was cut off abruptly without explanation and it has not been mentioned by Kenyan new papers or radio.

Special correspondent Roger Mann reported from Nairobi:

Even when it broke relations in 1973, it was apparent that the Kenyan government harboured pro-Israeli sympathies as does much of the population. When Israel Ambassador Reuven Dafni made his final flight home he was seen off at the airport by one of the Kenyan's most influential men, Attorney General Charles Njonjo.

Since then, Israel has been represented by a resident Israel interests officer who quietly plays the game of diplomacy from his home although Denmark officially looks after Israel's affairs in Kenya. Ghana and the Ivory Coast are the only other black African countries to have smimlar resident Israeli dimplonmats.

Kenyan members of Parliament have frequently called for a resumption of diplomatic links with Israel.

The same theme recurs often in letters, to the editor and Kenyan newspaper editorials are generally among the most pro-Israel in Africa.

Kenya is in a difficult position, however, because as one of Africa's most pro-West and capitalistic countries, it cannot afford to buck the tide of the mainstream of African thought too often without becoming an outcash. It also sees the benefits of being friendly to Israel while courting Arab aid and investment.