Nicolas Sarkozy’s hopes of running for president again next year have been dealt a blow by a court ruling that paves the way for him to stand trial for corruption and influence peddling. The former French leader had hoped that wire-tapped tapes of private conversations with his lawyer would be ruled illegal and inadmissible in court, leading to the case being thrown out.

But on Tuesday France’s highest court, the cour de cassation, ruled that investigators broke no law by using the phone taps, clearing the final obstacle for prosecutors hoping to bring Sarkozy to trial.

The decision is the latest in a series of legal problems besetting the ex-president, now leader of the opposition centre-right Les Républicains party. In a separate case, he was put under formal investigation in February over suspected irregularities in the funding of his 2012 presidential campaign, which he lost to the socialist François Hollande. The case is ongoing, but Sarkozy denies all wrongdoing.

The case ruled on by the cour de cassation on Tuesday centred on a judicial investigation opened in 2012 into allegations that Sarkozy’s campaign had received an illegal donation to the tune of €50m (£40m) from the Libyan dictator Muammar Gaddafi prior to Sarkozy’s successful 2007 election bid. As part of that investigation, which is ongoing, detectives placed phone taps on several phones belonging to Sarkozy and his lawyer, Thierry Herzog.

Sarkozy is alleged to have received illegal campaign donations from the late Libyan dictator Muammar Gaddafi in 2007. Photograph: Pascal Rossignol/Reuters

However, the recorded conversations pointed investigators in an entirely new direction. By chance, the taps picked up conversations suggesting that Sarkozy had been in contact with a magistrate, Gilbert Azibert, then a member of the cour de cassation, to ask for confidential information about another investigation into campaign donations from the L’Oréal heiress Liliane Bettencourt. In those conversations, it is alleged that Sarkozy promised Azibert promotion to a high-level position in Monaco in return for information on the case against him.

All investigations against Sarkozy in the so-called Bettencourt affair were later dropped and the case dismissed, but the tapes led to a new investigation into active corruption and influence peddling.

In May 2015, judges decided that Sarkozy, Herzog and Azibert should stand trial, but lawyers for the former president sought to have the case stopped by arguing that the phone taps breached lawyer-client confidentiality and that investigators had not obtained proper authorisation. The cour de cassation rejected this appeal.

The wiretaps were used on different telephone lines used by Sarkozy under his real name and under a false identity, Paul Bismuth, between 2013 and 2014. The real Paul Bismuth, an estate agent from Netanya in Israel who was at school with Herzog, was not amused, and threatened to sue. Herzog has admitted that he instructed his client to use a prepaid mobile phone registered under the alias for private conversations because he suspected that Sarkozy’s phone was being tapped.

In all the legal investigations, Sarkozy has repeatedly denied any wrongdoing and has argued that he is the victim of political and judicial plotting. He has never been sent to trial or convicted of any wrongdoing.

Les Républicains are expected to hold a primary election to select a candidate for the May 2017 presidential elections, in which Sarkozy is expected to face stiff opposition, including a rival bid from Alain Juppé, a former prime minister and mayor of Bordeaux. Polls give Juppé a solid lead over at least six other declared contenders, and more are expected to put their names forward.

The case is one of several investigations against Sarkozy since he lost his presidential immunity in 2012, but is potentially the most damaging to his political future. During his failed 2012 campaign, Sarkozy warned that if he lost his bid to become president, he would disappear from public life. He has since changed his mind.