The last of Israel's 119 Lebanese and Palestinian prisoners who were transferred from Lebanon to Atlit Prison near Haifa in April will be released Tuesday, the Israeli Army announced today.

The prisoners are part of a group of 700, most of them Shiite Moslems, whose release was demanded by the Shiite gunmen who hijacked a Trans World Airlines jetliner in June and held 39 Americans hostage in Beirut for 17 days.

The Israeli government continued to insist today that the gradual release of the prisoners over the past two months was not connected to any secret agreements with the United States or the Beirut hijackers, but was "in accordance with the security situation in south Lebanon."

A Foreign Ministry spokesman said Tuesday's planned release had been expedited "as a gesture of good will" to meet a request by the Japanese government during the current official visit to Japan by Foreign Minister Yitzhak Shamir, the first by an Israeli foreign minister.

"Japan has interests in the Arab world. It was not easy for them to go along with an official visit by an Israeli foreign minister. They mentioned it the prisoner release in talks with us more than once," a ministry official said.

The prisoners, some of whom have been in custody for as long as two years, had been seized in Lebanon on suspicion of involvement in attacks on Israeli forces there or on the Israeli-backed South Lebanon Army. They were brought to Israel in April from a prison camp in Lebanon when the Israeli Army was withdrawing from that country.

Israeli officials said that following the Tuesday release, no prisoners from the Lebanon conflict will be in Israel. Lebanese or Palestinian guerrillas captured in southern Lebanon by the Israeli Army or the South Lebanon Army are now being sent to a makeshift camp in the Lebanese village of Khiam, about five miles north of the border.