Abdullah Abdullah cited the government's refusal to make changes in the electoral commission.
Addressing his supporters in Kabul, the capital, on Sunday, Abdullah said: "I'll not take part in the election... I've not taken this decision easily."
In an interview with Al Jazeera shortly after the announcement, he said the decision was made after "a lot of consultations".
"It was the right decision, and I did it in the best interests of this country," Abdullah said.
"As far as the process is concerned, hopefully there is a way forward. I will not enter into the constitutional implications of this decision.
"But I'll be pursuing the agenda for change and reform in any capacity that I'll be. Perhaps, after a sigh of relief, I will enter into this role with my followers, with my supporters, with the movement that has supported me for the past five months."
Shortly after Abdullah's announcement, the campaign team of Hamid Karzai, the Afghan president, said the election would still go ahead.
"His [Abdullah's] withdrawal should not alter the process... The process should go on and the people of Afghanistan should be given the chance to vote," Wahid Omar, a Karzai spokesman, told Al Jazeera.
In Sunday's statements, Abdullah said a "transparent election is not possible" and that the Afghan government has been illegitimate since May.
The supreme court, appointed by Karzai, extended his mandate after the election was put off from last spring until August.
Earlier, Karzai had rejected a series of demands laid down by Abdullah, who previously served as foreign minister in his cabinet.