An Alitalia jetliner seized by three Arab gunmen departed for Iran early today after the hijackers freed the last 36 passengers aboard, airline president Umberto Nordio reported.

The hijacked plane originally had 175 passengers.

Nordio said that 11 crew members were aboard the plane under an agreement reached with the hijackers, who originally had demanded that they be flown to Cuba to ask delegates attending a conference of nonaligned nations to help them press the search for a missing Moslem leader. Iran apparently has agreed to receive them.

The gunmen say the leader, Imam Musa Sadr, has been held captive in Libya for more than a year.

Although an airport official and one passenger initially said the three hijackers were Kurdish nationalists, all later evidence indicated they were Lebanese Moslems of the Shiite sect that is predominant in Iran.

A written statement delivered from the plane demanded the release of Sadr, spiritual leader of Lebanon's Shiites.

The Alitalia DC8 jet, on a flight from Tehran to Rome, was commandeered by the gunmen shortly after a scheduled stop in Beirut, Lebanon.

The 54-year-old imam disappeared on a visit to Libya in 1978 and some of his followers claim he never left Tripoli, the Libyan capital. Libyan officials said he left their country on an Alitalia flight for Rome. Italy says it has no record of his entry.

In their English-language statement, the hijackers appealed for help from leaders attending the nonaligned summit.