Revered Wallace Charles Smith talks about the Shiloh Baptist Church’s history and how they are celebrating 150 years in D.C. (Hamil Harris/The Washington Post)

Shiloh Baptist Church, started in 1863 by freed slaves from Fredericksburg, has survived two fires, a nearby open-air drug market and gentrification of its neighborhood in Northwest Washington. Now it’s time to celebrate its 150th anniversary.

The church is known for hosting political leaders, and celebrants at a packed service on Sunday included Mayor Vincent C. Gray and Del. Eleanor Holmes Norton, who turned a speech into a sermon as she reflected on Shiloh’s legacy.

“This church is intertwined in the history of the city itself,” Norton said. “We love this church! We love this church. This church is the District of Columbia.”

With visitors ranging from the Rev. Martin Luther King Jr. to the Rev. Billy Graham, President Ronald Reagan to President Obama, Shiloh’s rich spiritual and political history as one of the District’s oldest congregations has endured through the decades.

In a sermon called “Looking Back in Gratitude, Looking Forward in Hope,” the Rev. Wallace Charles Smith listed many examples of how “the Lord has brought us from a mighty long ways.” In recent years, a key challenge has been the gentrification of the church’s Shaw neighborhood.

Deaconess Jacqueline Macon, center, is seen with others during a service that was part of the Sesquicentennial Celebration at Shiloh Baptist Church on Sunday. (Matt McClain/FOR THE WASHINGTON POST)

“New folks show up like we don’t belong here, but we have been here and we ain’t going nowhere,” Smith said. He broke into tears as he reflected on how King and many others helped build up the church. “We are a people of hope.”

JoAnne Beasley, general chairman of the celebration, said the church will host anniversary events throughout the year.

The church has “had trials and tribulations,” she said. “But we just want to thank Him and let the world know that Shiloh Baptist Church, at the corner of 9th and P, is moving on in God’s name.”

Thomas Dixon Tyler, the church’s minister of music, said it was important that the service include hymns, anthems and contemporary gospel music.

“What 21 slaves did here was to build a legacy that is reflective in our heritage,’’ he said. “They extended themselves, and so we incorporate every idiom of music and worship.”

Mildred Carroll, 90, who has attended Shiloh for 75 years, said the church has meant “everything spiritually” in her life.

Duke Smith, a retired Navy captain who serves on the church’s deacon board, said, “Shiloh has been an anchor in Shaw, and we look forward to more years of service and sacrifice.”