San Francisco officials have a message for homeowners who have long used the steep city-owned parcels in Bernal Heights as an extension of their backyards: Give us our land back.

For at least 50 years, property owners bordering Bernal Hill Boulevard have cared for triangular parcels of land as part of an informal agreement with the city.

The land separates the homes from Bernal Heights Boulevard, a popular dog-walking destination, a portion of which is closed off to traffic and owned by the Recreation and Park Department.

Over the years, property owners built retaining walls to help contain hillside erosion. They cut staircases into the steep terrain, planted flowers and trimmed pine trees and foxtails. Some installed tire swings and play areas. A few built fences on public land, not only for privacy but to keep dogs and kids from tumbling over the steep precipice.

“Everyone has cultivated these little pieces of land for as long as everyone has lived up here, and it was never an issue,” said Mark Sabatino, who has lived at 95 Andover St. for 22 years with his wife, Kathy Sabatino. “It was live and let live.”

But it’s no longer live and let live. The Recreation and Park Department is now demanding that the parcels be returned to the public, and the controversy is turning some longtime Bernal Hill residents against each another.

In the case of 95 Andover St. and the neighboring 168 Moultrie St., Recreation and Park Director Phil Ginsburg has given property owners until the end of May to remove a redwood fence that spans the two properties. If they don’t, the city will take down the fence and charge the property owners for the job, Ginsburg said.

In a letter to the property owners, Ginsburg said his department’s primary responsibility “is the stewardship of public parkland for all San Franciscans.”

On the one side, neighbors and city officials say the dispute is about the privatization of public land. But the fight also raises questions about the rights of property owners to take matters into their own hands when recreation areas are overgrown, neglected or subject to graffiti, littering, public drinking and other nuisances.

The Sabatinos, and their next-door neighbor Bev Anderson, say that a fence has been at that location for more than 50 years and that the city always told homeowners they could use the parcels in exchange for taking care of them. The Sabatinos say they spent about $50,000 caring for the land over 22 years. “We were told to care for the land, which we did,” said Kathy Sabatino.

Then, in 2017, the Sabatinos and Anderson built the redwood fence along the street, which cost about $14,000. While there had been a fence there for at least 50 years — most recently a chain-link barrier that was falling down — the 6-foot-high redwood fence drew some complaints from neighbors who said it was too tall and blocked views.

It also sparked criticism from neighbors Bud and Olga Ryerson, Bocana Street residents who started showing up to Rec and Park Commission meetings to complain about the privatization of public land on the hillside.

“For several years, we have been concerned about the encroachment over Bernal Hill Park,” Bud Ryerson told The Chronicle.

The construction of the new taller fence in 2017 was egregious, he said.

But more important than creating a buffer between the busy boulevard and their house, the fence is a matter of safety, the Sabatinos argue.

They say that the area of the park by their house is a frequent spot for drug dealing, prostitution and dumping. In May of 2017, the body of a man who had been shot and his tongue cut out was left by their back door. At least four stolen cars have been set on fire nearby, and fireworks shot off on the hilltop have sparked grass fires.

The Sabatinos said they call the police regularly, but the response is either slow or nonexistent.

“The No. 1 problem is that after dark this place is a whole different animal,” said Mark Sabatino. “We have a bona fide fear that if the fence comes out it’s going to be open season on us.”

In 2018, the city and the property owners reached a tentative compromise. The Sabatinos agreed to lower the fence to 42 inches, remove private property from the land — including a tree house they had built — and install a gate that would allow the public to access the property during park hours. But after a car by the fence was set on fire in February, the Sabatinos decided to close the gate. They also didn’t take down two sections of side fence the city had asked them to remove.

Supervisor Hillary Ronen, who lives a few blocks down the hill from the park and represents the district, said the city has no choice but to open the property.

“It’s unfortunate that this went under the radar for so many years, but once it came to light, it’s incumbent on Rec and Park to protect the public land for the public good,” Ronen said. “They would create an awful precedent if they created a special exception.”

Rec and Park spokeswoman Sarah Madland said the city is investigating several similar issues in other parts of San Francisco and “will work through the proper legal process to return the land to public use.”

For Bev Anderson, 89, the whole saga is baffling. She said that when she bought the property in 1966, a tall redwood fence was already there. That fence was the same height as the current one. Anderson said she doesn’t have the money or energy to stand up to the city.

“I can’t afford a lawyer, that is out of the question, and I am not inclined to fight,” she said. “I’ll just take it down.”

The illegal dumping has always been rampant on the land, Anderson said, and she would continue to clean it up “so as not to be ankle deep in garbage.”

For his part, Mark Sabatino said he is not going to comply with the order. “What they are saying is “take the fence down and get off our land. ... It’s ours now so beat it,” he said. “They are probably going to come down hard, but I don’t know what else we have to lose.”

J.K. Dineen is a San Francisco Chronicle staff writer. Email: jdineen@sfchronicle.com Twitter: @sfjkdineen