The congregation was silent inside Roxbury’s Twelfth Baptist Church on Sunday as a cellist played a mournful arrangement of “Amazing Grace’’ and worshipers considered the legacy of the Rev. Martin Luther King Jr. in the fractured United States that exists five decades after his death.
There was also joy, as the church choir sang celebratory hymns such as “Lift Every Voice and Sing’’ and “God Is My Everything,’’ prompting hand claps and gentle swaying among the women, men, and children of many backgrounds who filled every pew in the historic house of worship.
The purpose of this service, ministers at the church said, was to give thanks to God for placing King on the earth and assigning him a weighty destiny. It was a fate that for a time brought King to Twelfth Baptist, where he was an assistant minister in the early 1950s while he earned his doctorate in systematic theology at Boston University.
“It was destiny, my brothers and sisters, that Martin would go on from this place, and go out into the world and begin to speak the truth, because before he was born, God knew him,’’ said the Rev. Willie Bodrick II, referring to a quote from the Old Testament in which God tells Jeremiah he was chosen to be a prophet even before he was in the womb.
“And God knew the plans he had for him . . . and so he called him to speak out against injustice, to speak a message of love, to bring about a light in the midst of darkness. It was destiny,’’ Bodrick said of King. He exhorted the congregation to carry on King’s legacy.
“We too have a responsibility to disavow racism, and sexism, and homophobia, and all -isms,’’ he said. “We have a responsibility to live out the life that Dr. King stood for. He had a dream.’’
The congregation celebrated the accomplishments of the civil rights movement under King’s leadership and the distance African-Americans have traveled toward greater equality, including in Boston’s municipal government.
“This historic City Council is something to behold,’’ said the Rev. Arthur T. Gerald Jr., the church’s senior pastor, as he addressed Kim Janey, who earlier this month was sworn in to represent Roxbury in the chamber, and whose family has attended Twelfth Baptist for four generations.
“We haven’t had so many persons of color holding prominent positions on the City Council’’ ever before, Gerald continued, “and we shall be in prayer for you all as you work with our mayor.’’
The service celebrated progress, even as outside the sanctuary were many reminders that true racial parity remains elusive and threatened by opponents of equality.
The tribute to King was underway for less than 15 minutes before US Congressman Michael Capuano evoked President Trump’s alleged statement from three days earlier that denigrated Africa and Haiti, causing outrage within the black community and on both sides of the political aisle.
“This past week, I think, has really shown why we need to come together today,’’ he said.
Capuano said he does not claim to be a perfect person, and he didn’t want to condemn Trump for the alleged statement but rather to ask the congregation for prayer, in the spirit of King, that Trump will learn from his errors and “become a better person.’’
Mayor Martin J. Walsh celebrated King’s legacy and spoke of the ongoing process to create a permanent monument to King in Boston.
“We have a leader using hateful and racist language, and demonizing members of our community because of where they come from,’’ Walsh said. “Let me be clear: We all come from poverty. And there is no shame in poverty. There’s only shame in doing nothing about it.’’
Secretary of the Commonwealth William F. Galvin also alluded to Trump as he discussed his own role as chairman of the Massachusetts Historical Commission and the upcoming anniversary of King’s assassination at a Memphis motel on April 4, 1968.
“A few months ago, many of us in the area of historic preservation had to deal with the issue [of] what should we do with the monuments to dead racists,’’ Galvin added later. “Who would have ever thought we would have a living racist in the White House as we moved forward?’’
The congregation burst into applause.
When Janey addressed the congregation, she also referred to the president without naming him, telling them, “Dr. King’s legacy is in our hands. The question is what are we going to do with it.’’
In a brief interview, Janey said of Trump’s alleged comments, “It’s deeply upsetting. It’s deeply offensive.’’
The councilor’s mother, Phyllis Janey, 71, of Roxbury, said she simply tries not to pay attention to offensive statements made by the president and instead to focus on positive thoughts. “I still have hope,’’ she said. “I know there’s so much more in the world than what Trump has to say.’’
As the service ended, the congregation sought to put King’s dream into action, joining hands with their neighbors — black, brown, or white — as they swayed as one and sang the anthem of the civil rights movement, “We Shall Overcome.’’
Jeremy C. Fox can be reached at jeremy.fox@globe.com.