JOHANNESBURG, South Africa (AP) _ The Rev. Allan Boesak, a prominent anti-apartheid campaigner, today resigned his church posts to seek a political career after a scandal over an extramarital affair.

Boesak had announced July 8 he would step down as a Protestant minister following press reports about the affair with a television journalist.

Religious leaders and friends had since pleaded with him not to quit his church posts, but today he reaffirmed the decision to step down, effective immediately.

Boesak said he wanted to play a role in South African politics.

''I have ... decided to offer my services to the people of this country to bring about a united, non-racial and democratic South Africa. I am prepared to play any role which I may be called upon to play in this regard,'' he said in a statement released by his lawyer.

Boesak had served 21 years as minister of the Ned Geref Sendingkerk church in Cape Town and as president of the World Alliance of Reformed Churches, an international council of Protestant churches.

''This is one of the darkest days of my life,'' he told his congregation when he initially announced his plans to quit.

In today's statement, the mixed-race leader said he would continue his relationship with television journalist Elna Botha, and that he and his wife, Dorothy, would divorce.

He said he was not ashamed of his relationship with Ms. Botha and hoped the press would ignore his private life.

''The breakdown of my marriage was a fact long before I met Elna and what exists between us is a personal matter and nothing which I can be ashamed of. I have, therefore, no valid reason to discontinue such contact,'' the statement said.

Ms. Botha, in a separate statement, said she would continue to see Boesak. She said her marriage to television journalist Colin Fluxman had broken down before she began a relationship with Boesak earlier this year.

Ms. Botha works for the state-run South African Broadcasting Corp.

Boesak has played a major role in the opposition to apartheid, leading demonstrations and touring the world to denounce South Africa's racial segregation.

Boesak, who was long thought to be interested in a political career, models himself after the late Martin Luther King Jr.

The revelations about Boesak and Ms. Botha were seen as a moral scandal in South Africa since both were married and Boesak was an ordained minister.

Boesak came under fire in the mid-1980s following news reports of his involvement with a female church worker. A church inquiry later cleared him of any wrongdoing.