Lawyers from Wilmer Cutler Pickering Hale and Dorr have won the dismissal of an IRS case against United Church of Christ, Sen. Barack Obama’s denomination.

The IRS initiated an investigation early this year after a speech by Obama at a 50th anniversary celebration of the church last June. It was a reference by Obama to his presidential candidacy in a talk otherwise focused on faith that caught the agency’s attention.

Tax laws prohibit non-profits — including churches — from engaging in political speech or promoting candidates. The IRS can withdraw an organization’s tax-free status if the organization is found to violate the rule.

Obama has been a member of Trinity United Church of Christ in Chicago — a UCC congregation — for more than 20 years. The church has been in the headlines for several months now as the congregation lead by the controversial Reverend Jeremiah Wright.

WilmerHale was retained after church officials interviewed several firms, according to partner William Wilkins. “We were so interested in the case we offered to do it pro bono,” Wilkins says.

Firm lawyers, working with the church’s national counsel Donald Clark, proved that the church invited Obama to the event before he had announced his presidential run and did not sanction the campaign volunteers who had set up some tables with campaign information near the event.

Evidence presented in a letter sent to the IRS in late March pointed to ground rules the organization had established for Obama’s visit; the church even cautioned churchgoers against engaging in any political activity.

Had the IRS pursued the matter, it would have raised serious questions about the First Amendment’s application to church activities, Wilkins says.