Complex and secret negotiations between Foreign Minister Avigdor Lieberman and the Libyan authorities came to a dramatic conclusion Sunday when an Israeli who disappeared in March was freed from a Libyan prison.

Rafael (Rafram) Haddad, who is active in a society that seeks to preserve Libyan Jewish history, arrived in Vienna late Sunday after five months in prison.

Haddad, who holds dual Israeli and Tunisian passports, is due in Israel on Monday.

The ordeal began in March, when Haddad arrived in Libya to photograph buildings that once belonged to the Jewish community. While photographing one of the buildings, he was arrested by the local police and subsequently handed over to the Libyan intelligence authorities, on suspicions that he was a spy.

The entire affair has been subject to heavy censorship since March.

According to a senior government official, at the time of his arrest Hadad managed to telephone relatives in Tunisia, where he had been living for several years after moving there from Israel. The relatives contacted the Israeli foreign ministry, which opened contacts with Libya via several secret channels.

Israel approached several countries including the United States, France and Italy with a request to intercede with the Libyans, asking the intermediaries to stress that Hadad was not a spy but rather a civilian who had shown a lapse in judgment.

Italy's intelligence agency played a central role in early attempts to free Hadad after Prime Minister Benjamin Netanyahu made a personal approach to his Italian counterpart, Silvio Berlusconi. American Jewish groups are also thought to been involved in negotiations.

But representations through official channels failed and two months ago, Foreign Minister Avigdor Lieberman decided to use private contacts close to the Libyan regime to push for a deal. Lieberman approached a number of central and eastern European acquaintances, including Austrian businessman Martin Schlaff, a friend of Saif al-Islam Gadhafi, son of the Libyan leader.

Schlaff returned with a Libyan offer of a deal and Israel eventually allowed the cargo of a Libyan aid ship into the Gaza Strip in exchange for Hadad's release.