Part of a historic Maryland bridge that served as a lifeline to African Americans during segregation will be preserved on a recreational trail that will run along the future Purple Line, Montgomery County officials said Tuesday.

The Maryland Transit Administration has agreed to save the steel girders from the Talbot Avenue bridge, a 100-year-old span in the Lyttonsville area of Silver Spring, when it’s torn down to make way for the light-rail line, the county said.

Longtime residents of Lyttonsville, which was founded in 1853 by a free black laborer, have been fighting for several years to preserve the bridge’s history. For years, they say, it provided a critical link to surrounding areas, including white neighborhoods where black residents were allowed to work but not live. It carried them over freight railroad tracks to reach buses that took them to restaurants and stores in the District, when they weren’t allowed to eat out or shop in Silver Spring. They also met taxis at the bridge when cabdrivers refused to use Lyttonsville’s muddy, pothole-filled roads left unpaved long after those in white neighborhoods.

“I’m pleased with the fact that part of its history will be preserved,” said Patricia Tyson, 76, who has lived in Lyttonsville most of her life. “We used it for so many years — it was the way we got out of the neighborhood to where we wanted to go.”

The girders will be installed on a vacant state-owned parcel about two blocks from the bridge, near Talbot and Michigan avenues. They will form short walls on both sides of the Capital Crescent Trail to give runners and cyclists the feel of crossing a bridge.

“It will give people a feeling of history,” said Charlotte Coffield, 84, a third-generation Lyttonsville resident. “You talk to anyone from this community, and they have a story about the bridge. . . . You couldn’t do anything without crossing the bridge.”

Construction on the 16-mile light-rail Purple Line between Montgomery and Prince George’s counties started in August. It is scheduled to begin carrying passengers in 2022. One of the 21 stations and a train storage yard will be in Lyttonsville.

Maryland transit officials had planned to tear down and replace the bridge with a longer span across what will be a wider rail corridor once the Purple Line tracks are built alongside the CSX tracks. However, county officials closed the bridge abruptly in May after it failed a safety inspection.

Tim Cupples, Montgomery’s coordinator on the state’s Purple Line project, said the county and state are still discussing how much the preservation project will cost and who will pay for it.

“The good thing is it looks like we’ll be able to give residents what they’re looking for,” Cupples said. “We just need to work out the details to make it happen.”

State transportation officials did not make anyone available for an interview. In a statement, MTA spokeswoman Veronica Battisti said the state will use “replica girders” in the bridge-themed artwork chosen for the Lyttonsville station.

With the Talbot bridge’s future resolved, local residents say they’re still concerned about how they’ll get out of their community when another bridge, the Lyttonsville Place bridge, is also replaced during Purple Line construction. The state had initially required the contractor, Purple Line Transit Partners, to keep at least one of the bridges open at all times.

However, residents learned this fall that the state has allowed the contractor to close the Lyttonsville Place bridge for up to six months, even as the Talbot bridge remained closed. That would leave the community without a northern exit to reach the Capital Beltway and stores and other businesses on Brookville Road and Georgia Avenue.

Battisti said no date has been set for closing the Lyttonsville Place bridge. She noted that the county, not the state, had closed the Talbot bridge.

Coffield said she and other residents once again felt blindsided by Maryland transit officials making a decision without consulting the community it will affect. She said proposals to reroute vehicles, except heavy trucks, through the neighborhood during Purple Line construction would bring too much traffic to narrow streets.

“We shouldn’t be put through all that,” she said.