The agreement was announced after Foreign Minister Micheline Calmy-Rey flew in to the Libyan capital in the hope she could bring home Max Goeldi, who has been stranded in the North African country for nearly two years. “Max Goeldi will leave the country today,” she told reporters in the Libyan capital.

“Goeldi will return to Switzerland and this is the start of the normalization of relations between the two countries.”

Goeldi was barred from leaving Libya in July 2008, days after Swiss police arrested Hannibal Qaddafi, a son of Libyan leader Muammar Qaddafi, on charges, later dropped, of abusing two domestic employees.

The row sucked in the European Union and the United States. European countries are anxious to restore friendly relations with oil exporter Libya because they want to safeguard burgeoning business ties.

Calmy-Rey said Switzerland had apologized for the publication of photographs of Hannibal Qaddafi after he was arrested in Geneva in July 2008. The Swiss foreign minister was speaking after hours of talks that ended in the signing of an agreement on relations with her Libyan opposite number, Moussa Koussa.

Libyan officials deny any link between the two cases but supporters of Goeldi, who works for engineering firm ABB, have said they believe he was caught up in the diplomatic fallout from Hannibal Qaddafi’s arrest. Goeldi was released from a Libyan prison last week where he had been serving a four month sentence for violating immigration rules. Before he was jailed he had not been held in detention but was unable to move freely or leave the country.

Libya reacted to Hannibal Qaddafi’s arrest at a lakeside hotel in Geneva by stopping oil exports to Switzerland and withdrawing assets from Swiss banks.

Qaddafi declared a “jihad” on Switzerland, although his officials said he had meant a trade embargo, not a holy war. Libya briefly barred entry to citizens of most European countries in retaliation for a Swiss travel ban on senior Libyans, including members of the Qaddafi family.

Tripoli also warned US energy companies operating in Libya their interests could be hurt after a US official made disparaging remarks about Qaddafi’s stance on Switzerland. The US official later apologized.