The Rev. Samuel T. Lloyd III, longtime rector of Trinity Church in Copley Square, announced this week he will retire in June after two tours totalling nearly two decades as leader of the historic church.
In a letter to the congregation released Monday evening, Lloyd, 66, said he had suffered recurrent headaches in the last year. He said that he had responded well to medication and felt vigorous after a good summer but that Trinity needed a leader “at the top of his or her energy level.’’
“I remember hearing that when the distinguished former judge and White House counsel Abner Mikva announced his retirement after only one year in office, he explained, ‘I don’t find the rubber band snapping back as fast at 69 as when I was 40,’ ’’ he said. “I know what he means.’’
Lloyd, who was not available for an interview Wednesday, said in the letter that he and his wife hoped to travel and visit with friends and that he would still occasionally preach and teach.
Patricia Hurley, a spokeswoman for Trinity, said Lloyd’s announcement came a few years earlier than expected.
“So far, the reception is one of shock and sadness,’’ she said, “but also completely understanding that this is the right choice for him right now.’’
The Rev. William W. Rich, the vicar of Trinity, will lead the Episcopal congregation after Lloyd retires, and then the vestry — the elected board that governs the church — will decide how to move forward in searching for his replacement.
“[O]ur lives have been profoundly touched by his preaching, teaching, and pastoral leadership,’’ said Peter Lawrence, the senior warden, and Anne Ogilby, the junior warden, in a letter to the congregation accompanying Lloyd’s. “In innumerable ways, we are the vibrant and resilient parish we are today by the grace of his visionary ministry.’’
Lloyd served as rector for 12 years before leaving in 2005 to become dean of the Washington National Cathedral. He returned to Trinity in 2011.
Known for his intellectually rigorous sermons and talents as a teacher, Lloyd revamped the church’s Christian educational offerings for children and adults; a recent adult class he taught on Sundays attracted about 150 people a week, Hurley said. He also presided over significant renovations of the nearly 140-year-old building.
He has thrown open Trinity’s doors for interfaith gatherings, and he was instrumental in laying the groundwork for, and aiding the expansion of, the Trinity Boston Foundation, the church’s nonprofit social service arm. It boasts a $2.3 million budget and works directly with about 500 Boston public school students, as well as with other groups, with a focus on helping youth of color thrive.
“It feels like now we have social justice work that is on par with the preaching and the music and the historic building,’’ said the foundation’s executive director, Louise Packard.
His tenure has not been without controversy. In 2014, the vestry’s purchase of a $3.6 million condominium on Beacon Hill to house Trinity’s rector provoked painful discussions about priorities. Hurley said the question of whether to keep the rectory “pops back up from time to time’’ and may come under review at a later date, but there were no immediate plans to reevaluate.
She said membership had continued to grow, to about 800 families who pledge annually. Trinity also recently received a $27 million gift for a permanent endowment that, beginning in 2027, will provide steady income for maintaining the church building.
“While continuing the identity Trinity has had for over a century as a center for powerful preaching and proclamation, Sam has also nurtured a parish community in which individuals are equipped for the quiet work of personal spiritual growth,’’ said Bishop Alan Gates of the Episcopal Diocese of Massachusetts. “His tenure as rector has also been marked by an increase in Trinity’s active engagement with issues of poverty and justice in the city.’’
Lloyd plans to stay through the completion of another capital campaign to support building maintenance and to further expand Trinity’s outreach work. And in February, the church plans to replace a bookstore in the building’s understory with a chapel, something Hurley said the church had been “dreaming about’’ for the last century.
The Rev. Nancy Taylor, senior minister of Old South Church across Copley Square, called Lloyd “a terrific pastor and great neighbor.’’
“He has led Trinity Church with grace and strength, assuring its importance to Boston and beyond,’’ she said.
Lisa Wangsness can be reached at lisa.wangsness@globe.com.