The United Methodist Church has dropped charges against a pastor who officiated at the wedding of his son to another man in New York, which legalized gay marriage in 2011.

The Rev. Thomas Ogletree, 80, was formally charged with violating church law, which prohibits gay unions. The trial was expected to open Monday at First United Methodist Church in Stamford, Connecticut.

Ogletree and Bishop Martin McLee jointly announced that the church was dropping its case at a press conference held in White Plains, New York.

McLee also pledged that he would not prosecute pastors for ministering to LGBT people.

“I am grateful that Bishop McLee has withdrawn this case and the church is no longer prosecuting me for an act of pastoral faithfulness and fatherly love,” Ogletree said. “But I am even more grateful that he is vowing not to prosecute others who have been likewise faithful in ministry to LGBTQ people. May our bishop's commitment to cease such prosecutions be the beginning of the end of the United Methodist Church's misguided era of discrimination against LGBTQ people.”

Last year, the church defrocked pastor Frank Schaefer of central Pennsylvania. Schaefer, who has three gay children, was found guilty of violating church law for officiating at his gay son's wedding.

(Related: Frank Schaefer, pastor defrocked over gay wedding, considering job offer.)

The Rev. Randall Paige of Christ Church UMC in Port Jefferson Station, New York led in filing the complaint against Ogletree. A wedding announcement in The New York Times prompted Paige and others to act.