A South African judge threw out corruption charges against the controversial former deputy president Jacob Zuma yesterday, freeing him to pursue what is expected to be a popular but highly divisive campaign to become the next president.

The dismissal of the case was greeted with jubilation by Mr Zuma's supporters, who say he was the target of a politically motivated prosecution because of his opposition to Thabo Mbeki's economic and Aids policies. Mr Zuma remains deputy president of the African National Congress, and the charges against him had led to the party's worst internal wrangling since it came to power 12 years ago.

Judge Herbert Msimang dismissed the charges of accepting bribes from a French weapons company after the prosecution said its case was still not prepared, even though Mr Zuma first appeared in court nearly a year ago, and asked for a further postponement. Charges against the French firm, Thint, were also thrown out.

The judge said the state's case had "limped from one disaster to another" and that he had no choice but to halt the trial.

Prosecutors could refile charges at any time, but such a move would be likely to inflame accusations that the accusations are politically motivated.

"I said I was innocent," Mr Zuma told supporters outside the Pietermaritzburg courtroom. "Everything has been brought to finality. If there are any others who would like to bring me back to court they must start afresh."

The ruling leaves Mr Zuma as the favoured candidate to succeed Mr Mbeki as leader of the ANC next year, a position that virtually guarantees election as president in 2009. But Mr Zuma, 64, who is strongly backed by unions, communists and other opponents of the present government's business-oriented policies, has proved a divisive figure.

Mr Mbeki sacked him as deputy president last year after a judge said Mr Zuma had a "generally corrupt" relationship with his financial adviser, Schabir Shaik, who is serving 15 years in prison for fraud and corruption over a £2.1bn weapons deal. The prosecution alleged that Mr Zuma had asked Mr Shaik to secure a 500,000 rand (£37,000) a year payment from Thint to deflect investigations into the controversial arms purchases.

But support for Mr Zuma has grown, despite the corruption allegations and a rape trial earlier this year. He was acquitted of rape but drew stinging criticism after he admitted knowingly having sex with an HIV-positive woman without using a condom, and for telling the court that he took a shower after sex as a means of protection from Aids.

Mr Zuma's prosecution divided the ANC along lines likely to be reflected in the succession battle. Mr Mbeki's opponents inside the party have been increasingly drawn to Mr Zuma as the most likely candidate to prevent the outgoing president from handpicking a successor.

The quashing of Mr Zuma's corruption trial coincided with the annual conference of the trades union confederation, Cosatu, which has called for the former deputy president to be reinstated. "The overwhelming majority of the working people, the poor, the marginalised, should be very happy today," said Cosatu's secretary general, Zwelinzima Vavi. "This was all a politically conspired case to prevent him from advancing his political career."

Mr Zuma has considerable but not unanimous support within the trade union movement, particularly because of his criticisms of Mr Mbeki's economic policies that emphasise economic growth over redistribution of wealth.

Without explicitly endorsing Mr Zuma, Cosatu has encouraged its members to take part in the ANC's succession battle in an effort to bring the party back to policies that benefit the poor. Cosatu, as a member of an alliance with the ANC and Communist party, will play an influential role in choosing the next leader.

State prosecutors remained defiant yesterday that they had been right to pursue the case. "As the prosecuting team has assured the court, it has a strong and winnable case against the accused," a spokesman said. Government lawyers are expected to decide within six weeks whether to launch a fresh prosecution.