Jean-Claude Juncker, the prime minister of Luxembourg and the world's longest-serving elected leader, has resigned after a series of lurid scandals involving the tiny Grand Duchy's secret service.

Following seven hours of debate in the Luxembourg parliament, Mr Juncker announced that he would step down after it became clear that his coalition partner would not support him in a vote of no confidence.

“I’m not perspiring because I’m scared but because it’s hot,” he told Luxembourg MPs sardonically, but his characteristic humour was not enough to save his political skin.

Mr Juncker has been forced to resign over his failure to control Luxembourg’s secret service, for which he is responsible as the country’s prime minister.

“Le Service de renseignement de l’Etat luxembourgeois”, or SREL, is currently being investigated by the state prosecutor for illegal wiretapping, corruption and dealing in stolen cars.

The most prominent victim of bugging was Mr Juncker himself, when the intelligence agency’s director, Marco Mille, used a recorder disguised as wristwatch to secretly record a meeting with the prime minister in January 2007.

In the recorded conversation, Mr Mille claimed that his staff had also secretly taped a conversation with Luxembourg’s head of state and made the allegation that Grand Duke Henri was in regular contact with Britain’s MI6. This version of events is denied by Mr Juncker.

A parliamentary inquiry discovered that the SREL carried out illegal wire-taps, kept 13,000 secret files on people and ran a fictional counter-terror operation that was really a front to help a Russian oligarch pay $10 million to a Spanish spy.

“Are we responsible for something we did not know? I do not think so,” said Mr Juncker.

A heavy smoker with a love of fine cognac, Mr Juncker, 58, has been in power as prime minister for 18 years, a world record. During eight years in office as the head of the eurozone, until January this year, his wily political skills were credited with holding the European Union’s single currency together during the debt crisis.

“The intelligence service was not my top priority,” admitted Mr Juncker, before adding with customary aplomb, “moreover I hope Luxembourg will never have a prime minister for whom the SREL constitutes a priority.”