(CNN) -- Sen. Barack Obama said Saturday that he has resigned from the church where controversial sermons by his former pastor and other ministers created political headaches for his campaign.

"We don't want to have to answer for everything that's stated in the church," the Democratic front-runner said. "We also don't want the church subjected to the scrutiny that a presidential campaign legitimately undergoes."

The resignation comes days after the Rev. Michael Pfleger, a visiting Catholic priest, mocked Obama's Democratic rival during a sermon at Trinity United Church of Christ in Chicago, Illinois.

In the sermon, Pfleger wipes his eyes with a handkerchief and suggests that Sen. Hillary Clinton wept because she thought that as a white person and the wife of a former president, she was entitled to the presidency.

Pfleger is a Catholic priest at St. Sabina Roman Catholic Church on Chicago's southwest side. He is also a friend of Trinity's former pastor, the Rev. Jeremiah Wright, from whom Obama distanced himself in April. Watch Pfleger mock Clinton »

Obama said the Pfleger controversy made it clear that, as long as he remained a member of the Trinity congregation, remarks from the pulpit would be "imputed" to him, even if they conflicted with his personal views.

Don't Miss

Obama said he and his wife, Michelle, began discussing a departure from the church after Wright spoke at the National Press Club on April 28.

During the appearance, Wright said that Obama had "distanced" himself the fiery pastor for political reasons.

Wright, Obama's minister for about 20 years, drew unwanted attention for the campaign when videos of his fiery sermons surfaced.

In the speeches, Wright suggested that the U.S. government may be responsible for the spread of AIDS in the black community and equated some American wartime activities to terrorism.

Obama has said he was not present for the controversial sermons by Wright or Pfleger.

His campaign condemned Pfleger's comments.

"That is why I am 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," he said in a statement Thursday.

Obama said he and his wife had discussed and prayed on the issue with Trinity's senior pastor, the Rev. Otis Moss, and hoped that the decision would withdraw Trinity from the spotlight.

"Though we are saddened by the news, we understand that it is a personal decision," Moss said in a statement Saturday. "We will continue to lift them in prayer and wish them the best as former members of our Trinity community,"

Some Obama supporters, including U.S. Rep. Robert Wexler of Florida, said that disconnecting from the church signaled a chance for the campaign to move on.

"I think it bodes well for us in the general election that we can put whatever issues there were behind us in respect to the church," Wexler said.