Libya has struck a new blow in its long-running spat with Switzerland by sentencing two Swiss businessmen convicted of visa and tax offences to jail in apparent retaliation for the arrest in Geneva of Muammar Gaddafi's son.

Rachid Hamdani and Max Goeldi have been held in Libya since July 2008 after Hannibal Gaddafi and his wife were accused of beating their domestic employees in Switzerland. The Swiss case was later dropped.

The two businessmen were given 16-month prison terms, it was confirmed in Tripoli and Berne.

The affair, which has caused outrage in Switzerland, is said by some commentators to have influenced last weekend's Swiss vote to outlaw minarets — raising questions about anti-Muslim prejudice and freedom of religion that fuelled debate across Europe.

Hamdani and Goeldi are sheltering in the Swiss embassy in Tripoli and are regarded as hostages. Libya officially denies the case has any connection with the Hannibal Gaddafi affair.

The row began when police arrested Hannibal — the Libyan leader's youngest son — and his pregnant wife, Aline, in a Geneva hotel after receiving reports that they had abused two servants. The couple spent two nights in custody and left Switzerland after being freed on bail.

Goeldi, a director of the Swiss engineering company ABB, was then arrested in Tripoli, as was Hamdani. Both were imprisoned for alleged breaches of immigration rules, but released and banned from leaving the country .

Since then, Libya has imposed trade sanctions on Switzerland, stopped Swiss flights to Tripoli, withdrawn more than $5bn from Swiss banks and cut the crude oil exports that provide half of all Switzerland's oil needs.

Last August the Swiss president, Hans-Rudolf Merz, flew to Tripoli to deliver an "official and public apology for the unjustified and unnecessary arrests". He promised to have Hannibal Gaddafi's arrest investigated by an independent panel. Libya promised but failed to restore normal relations.

Merz was then lambasted at home for a move that for some had echoes of Scotland's release of AbdelBasset al-Megrahi, the convicted Lockerbie bomber.

The following month Hannibal Gaddafi's servants withdrew their complaint after agreeing a financial settlement. Finally, this autumn, Goeldi and Hamdani looked set for release but the row erupted again when a Swiss paper printed pictures of Hannibal looking dishevelled after his arrest. That was seen in Tripoli as a humiliation to the Gaddafi family.

The sentencing may have been in retaliation for the Swiss minaret ban, which was supported by 57% of those polled. But a more prosaic explanation is that the legal action was in the pipeline and that the timing was coincidental.

The new twist in this saga ensures relations will remain troubled at a time when Switzerland, like other European countries, is competing for lucrative deals in an oil-rich country that has attracted huge commercial interest since it disavowed terrorism and nuclear weapons and emerged from international isolation a few years ago.

Last week Libya was told it would not be invited to attend the prestigious Davos economic forum in Switzerland until the dispute is settled. Hannibal's elder brother, Saif al-Islam, their father's likely heir, often visits Britain and is said to be close to the business secretary, Lord Mandelson.