ABERDEEN, S.D. - Sen. Barack Obama said yesterday that had resigned his 20-year membership at the Trinity United Church of Christ in Chicago "with some sadness" in the aftermath of inflammatory remarks by his longtime pastor and more recent fiery remarks at the church by another minister.

"This is not a decision I come to lightly . . . and it is one I make with some sadness," Obama said at a news conference after campaign officials released a letter of resignation sent to the church on Friday.

"I'm not denouncing the church, and I'm not interested in people who want me to denounce the church," the Democratic presidential front-runner said, adding that the new pastor at Trinity and "the church have been suffering from the attention my campaign has focused on them."

Obama said he and his wife, Michelle, had been discussing the issue since the late-April appearance by his former pastor, the Rev. Jeremiah A. Wright, at the National Press Club in Washington that reignited a furor over remarks Wright had made in various sermons at the church.

"I suspect we'll find another church home for our family," Obama said.

He said it was clear that since he is a presidential candidate, any remarks made at Trinity by any speaker "will be imputed to me even if they conflict" with Obama's stated views and values.

Obama said he had "no idea" how the resignation would "impact my presidential campaign, but I know it's the right thing to do for the church and our family."

"This was a pretty personal decision, and I was not trying to make political theater out of it," he said.

For months, Obama's campaign has been hurt by the rhetoric of Wright, whose sermons blaming U.S. policies for the Sept. 11, 2001, attacks and call of "God damn America" for its racism became fixtures on the Internet and cable news networks.

Initially, Obama said he disagreed with Wright but portrayed him as a family member he couldn't disown. The preacher had officiated at Obama's wedding, baptized his two daughters, and been his spiritual mentor for about 20 years.

But six weeks after Obama's well-received Philadelphia speech on race, Wright contended at the Press Club appearance that the U.S. government was capable of planting AIDS in the black community, praised Nation of Islam leader Louis Farrakhan, and suggested that Obama was acting like a politician by putting his pastor at arm's length while privately agreeing with him.

The next day, Obama denounced Wright's comments as "divisive and destructive."

Remarks by Wright inflamed racial tensions and posed an unwanted problem for Obama as he sought to wrap up his party's nomination.

More recently, racially charged remarks from Trinity's pulpit by another pastor, the Rev. Michael Pfleger, reignited the controversy. Pfleger, as a guest speaker at the church, mocked Obama's Democratic rival, Hillary Rodham Clinton.

Obama made clear his displeasure with the comments, in which Pfleger pretended he was Clinton crying over "a black man stealing my show." The candidate said he was "deeply disappointed in Father Pfleger's divisive, backward-looking rhetoric, which doesn't reflect the country I see or the desire of people across America to come together in common cause."

Pfleger, too, issued an apology, saying he was sorry if his comments offended Clinton or anyone else.

The news of Obama's decision to leave his church broke late on a Saturday, and while attention was focused on the Democratic National Committee's struggle to seat delegates from Florida and Michigan.

Republican John McCain also has had his woes with religious leaders.

Last month, McCain rejected endorsements from two influential but controversial televangelists, saying there was no place for their incendiary criticisms of other faiths.

McCain spurned the months-old endorsement of Texas preacher John Hagee after an audio recording surfaced in which the preacher said God had sent Adolf Hitler to help Jews reach the promised land. McCain called the comment "crazy and unacceptable."

McCain also later repudiated the support of Rod Parsley, an Ohio preacher who has sharply criticized Islam and called the religion inherently violent.