Nicolas Sarkozy's battle for re-election has been overshadowed by a major corruption scandal after two of his closest friends were charged by judges investigating alleged kickbacks on arms sales to Pakistan.

The investigation, known as the "Karachi affair", is the biggest French corruption scandal since the second world war, Sarkozy's political opponents said.

It is a potentially murderous saga of alleged illegal party funding, suitcases stuffed with banknotes, rightwing political rivalry and, ultimately, the deaths of 15 people in a bomb attack in Pakistan.

Nicolas Bazire, one of Sarkozy's closest friends and best man at his wedding to Carla Bruni in 2008, was charged on Thursday with misuse of public funds. He is suspected of taking kickbacks from the sale of submarines to Pakistan in the 1990s. Bazire, a former political aide who is now a director of French luxury goods group LVMH, was detained by police and his home and office were searched.

Thierry Gaubert, another friend and adviser to Sarkozy for many years, was also charged and placed under investigation on suspicion that he carried cash from kickbacks into France in suitcases.

Judges are investigating whether kickbacks from arms sales were used to illegally fund the failed presidential campaign of former rightwing prime minister Edouard Balladur in 1995. Sarkozy was Balladur's budget minister as well as spokesman for his campaign, which was run by Bazire. Lawyers for Bazire and Gaubert denied any involvement. The Élysée Palace issued a statement that said Sarkozy "never exercised the slightest authority in the campaign financing".

Sarkozy, who faces a presidential election in seven months, is under pressure as judges investigating the Karachi affair close in on his inner circle. A separate judicial inquiry is already looking at whether Sarkozy or his party members took cash from the billionaire L'Oréal heiress Liliane Bettencourt for illegal party funding.

When he was elected in 2007, Sarkozy had promised an "irreproachable" France, presenting himself as a leader who would clean up corrupt French politics. This is now being ridiculed by the left. Sarkozy has not yet officially declared his candidacy in next year's election, but he has been positioning himself to run, trying to create a more presidential image through his involvement in world affairs, in Libya and the Middle East.

The Karachi saga goes beyond illegal party funding. In May 2002, a bomb attack on a bus in the city killed 15 people including 11 workers for a French naval defence company on their way to the dockyard to work on submarines that had been sold to Pakistan. French judges now believe it was a retaliation attack over unpaid government bribes. A top investigating judge has opened a fresh examination into a possible connection to kickbacks and party funding despite efforts by the state prosecutor to stop the inquiry.

The arrest of Sarkozy's friends follows another surprising twist. Two ex-wives involved in bitter and difficult divorce battles with key figures came forward and gave evidence to judges. An influential Franco-Lebanese arms broker and businessman, Zied Takieddine, was last week charged with fraud over two arms contracts with Pakistan and Saudi Arabia in which he was allegedly the middleman. His ex-wife had testified to investigators. Then the trail led to Gaubert, whose ex-wife, a granddaughter of the last king of Italy, told judges of several trips to Switzerland in 1994 and 1995 when he returned with "voluminous suitcases full of banknotes".

Yet another sleaze inquiry was opened last week into assertions by one of Sarkozy's Africa experts that the former president Jacques Chirac and prime minister Dominique de Villepin were handed briefcases of cash from African leaders to fund election campaigns. A Chirac adviser had claimed that Sarkozy also benefited. All have denied taking cash.