Maryland’s highest court ruled Friday that homeowners along a wooded trail planned for a light-rail Purple Line can’t claim ownership to part of the trail they’d long considered part of their yards, saying the land has always been intended for public use.

The ruling against a Chevy Chase resident who argued that he owned a 14-foot strip of trail land because it had been fenced into his back yard for decades marks a victory for Montgomery County. The decision means the county won’t have to re-purchase land from property owners who have argued that they took “adverse posession” of land along the trail shoulders by building there when it was owned by a freight railroad company.

The county bought the trail land from a freight railroad in 1988 for $10 million to preserve it for a transitway. It’s now planned for use as the western three-mile segment of a 16-mile light-rail Purple Line. The decision comes as the county recently ordered about 80 property owners to remove their fences, sheds and other structures from the trail’s shoulders by April 30, as the state’s Purple Line project moves closer to construction.

Patrick Lacefield, spokesman for Montgomery County Executive Isiah Leggett (D), said of the ruling, “We are pleased that the court agreed with our perspective.”

The county fined the Chevy Chase resident, Ajay Bhatt, $500 in 2013 after citing him for building his six-foot-high wooden fence in the public right of way. Bhatt fought the citation, arguing that previous owners of his home had taken adverse possession of the 14-foot strip by having a fence in the same location since at least 1960.

A District Court judge upheld the citation before a Circuit Court judge overturned it in December 2014, ruling that Bhatt could prove an adverse possession claim. The county appealed the Circuit Court ruling to the high court.

Bhatt said Friday that he was disappointed and believes his fence was the county’s “first target” because of his activism against the Purple Line route. Bhatt is president of Friends of the Capital Crescent Trail, a citizens group that has filed a federal lawsuit opposing the light-rail alignment along the trail between downtown Bethesda and Silver Spring.

“The most regrettable fact about this entire dispute is the appearance that I was selected because of my activism to save the trail, as it has been a de facto park for over 20 years,” Bhatt said.

The Maryland Transit Administration plans to build the Purple Line between Bethesda and New Carrollton to connect neighborhoods in Montgomery and Prince George’s counties with Metrorail lines and Amtrak and MARC commuter rail stations. The county plans to rebuild the recreational trail, known as the Georgetown Branch Trail, alongside the train tracks, but thousands of mature trees will be cut. If the state secures $900 million in federal funding, it plans to begin Purple Line construction later this year or in early 2017 and open the line to service in 2021.

In the 22-page opinion written by Judge Glenn T. Harrell Jr., the Court of Appeals said Bhatt’s fence case “hints at plenty of potential trouble” for the Purple Line and the recreational trail. The court described both as “a pair of public works projects . . . cherished by the government and some citizens of Montgomery County.” The Court of Appeals found that railroad lines, even ones that are privately owned, legally have been considered devoted to public use, akin to highways. Because no one may claim adverse possession to such public land, the court said, the previous owners of Bhatt’s home could not have assumed ownership of the trail land from the freight rail company.