WASHINGTON (CNN) -- House Speaker Dennis Hastert on Thursday appointed the first Roman Catholic priest ever to serve as House chaplain after earlier passing over another Catholic candidate in a move that created a political firestorm.
Rev. Daniel Coughlin, vicar of the Archdiocese of Chicago, was named House chaplain, following the withdrawal of the Presbyterian minister who was Hastert's first choice.
In an emotional speech on the House floor, Hastert (R-Illinois) said the controversy over the naming of the chaplain had been "partisan," "ugly" and had brought "shame" upon the House.
"I am today, under the authority granted to me under the rules and precedents of this House to fill vacancies, naming Daniel Coughlin to serve as Chaplain of the House," he said.
Earlier, Rev. Charles Parker Wright, Hastert's first choice to be the chaplain, withdrew his candidacy for the position in a letter to the speaker.
Sources said Wright and Hastert met privately on Tuesday and then on Wednesday, Wright, a Presbyterian minister, sent a letter to Hastert taking himself out of contention for the position.
In the letter, Wright said, "I regrettably request you consider withdrawing my appointment to become Chaplain of the House at this time."
Wright's withdrawal cleared the way for a resolution to a controversy that has roiled the House for three months.
Hastert's decision to name Wright instead of Father Timothy J. O'Brien, a Roman Catholic priest and the top choice of a bipartisan House panel of 18 members, set off a firestorm of protest.
Hastert vehemently denied charges of being anti-Catholic. But many members of the House leadership are born-again Christians who expressed some discomfort with Catholics.
Rev. O'Brien, speaking before Father Coughlin was appointed, told CNN he hoped the House would follow an orderly process in filling the position. He added: "I did not expect all of this controversy."
Republicans were stung by the controversy and concerned it would hurt the party with Catholic voters, particularly after GOP presidential hopeful George W. Bush's controversial appearance at Bob Jones University, whose founder considers Catholicism a cult.
"My friends, in all my years in this Congress," Hastert told the House, "I have never seen a more cynical or more destructive political campaign. That such a campaign should be waged in connection with the selection of the House chaplain brings shame on this House."