The lush green hills, valleys and oak groves of Palo Alto’s 1,400-acre Foothills Park were populated with wildflowers, deer and lawbreakers on a mostly sunny day last week.

The scofflaws included small children who screamed happily as they hiked around Boronda Lake, a retired couple out for a morning walk, a woman taking pictures of poppies and lupine, and a woman enjoying lunch and the sweeping view from her car parked on Vista Hill, elevation 950 feet.

All were in violation of the Palo Alto Municipal Code, which declares: “Only residents of the city and regular or part-time city employees, members of their households related by blood, marriage, or adoption, or their accompanied guests are entitled to enter on foot or by bicycle or vehicle and remain in Foothills Park.”

The ordinance, which dates back to the park’s 1965 opening, allows city employees or police to demand documents — a driver’s license is recommended — that prove identity and residency. The park’s large wooden entrance sign on Page Mill Road announces the requirement, “Palo Alto residents and accompanied guests only,” as does a smaller sign at the entry kiosk.

While no one seems to keep official records, Foothills appears to be the only publicly owned park in California that excludes nonresidents. Some parks inside gated communities and other private developments are reserved for residents, and some municipalities charge differing fees for residents and nonresidents. But public parks are usually open to members of the public — from anywhere.

“That’s an uncommon thing that a park would be restricted to residents only,” said Stephanie Stephens, executive director of the California Park & Recreation Society, an association that supports the state’s 525 public park and recreation agencies. “It’s definitely one of those head-scratchers.”

Foothills Park’s residents-only law is nothing new — nor are accusations that it’s elitist, discriminatory or just plain wrong. The gripes surfaced recently on social media, when a former Palo Alto city councilman sparked a brief discussion with a tweet this month that accused the city of “institutional racism” for excluding nonresidents from the park.

“My ‘liberal’ hometown #PaloAlto still exemplifies #institutionalracism: Foothills Park is ‘residents only,’” Cory Wolbach tweeted, while also linking the issue to housing reform.

Palo Alto’s population is 64.2% white, according to the 2010 census, compared with 52.5% for the nine-county Bay Area as a whole.

The law’s roots reach back to 1959, when Palo Alto decided to buy the land to preserve it as open space. The city asked neighboring cities to participate in the purchase, but they declined.

“So, Palo Alto decided to limit its use to its residents,” said Kristen O’Kane, chief operating officer of the city’s community services department, which oversees parks and open space operations. The park opened, and the residents-only restriction started in 1965.

Every few years, the question of whether to continue the practice arises, O’Kane said. It came before the City Council once in the 1970s, once in the 1990s and most recently in 2005. Each time the council upheld the nonresident ban, she said.

The rationale for reserving the park for residents is that the city ordinance limits the number of people using the natural preserve area to 1,000. Given that restriction, council members reasoned, residents should be given preference.

Wolbach said he broached the issue on the council during his term, which ended in 2018, but his colleagues were not interested, even if nonresidents were charged fees.

It's shameful for Palo Alto to perpetuate our segregationist history, through exclusionary housing and "resident only" park policies. As a (former) Council Member, I pushed for change, but found no appetite among my colleagues, even w/ congestion pricing for non-residents. — Cory Wolbach (@corywolbach) April 8, 2019

Palo Alto enforces the ordinance mainly on weekends by stationing an employee at the front entrance to check IDs. Currently, during the week, nobody guards the gate and nonresidents are free to use the park.

On Tuesday, many of the visitors readily admitted to breaking the law but declined to give their names. They said they live nearby — in Los Altos Hills, Menlo Park, East Palo Alto or Atherton — and they knew the entrance would be not be patrolled on a breezy spring weekday.

“During the week anyone can come in,” said Walt Johnson, a Palo Alto resident who was not offended by the lack of enforcement.

A retired couple in their 80s, who live in nearby Los Altos Hills, declined to give their names for fear they’d be discovered as lawbreakers and excluded from the park. Both said they could understand the reason for wanting to restrict the park to residents, but they still thought it should be open to all.

“It’s been a conundrum about this park,” the man said. The couple said the park is clean, well maintained and peaceful. “It’s a beautiful park, but they should have a pass for nonresidents. I’d be happy to buy a pass — $100, $200 — if they were offered.”

Michael, an Atherton resident, sat on a dock at the edge of the lake while his kids and grandchildren took a hike. Palo Alto bought and maintained the park, so it makes sense to reserve it for residents, he said. But he also sees the issue in a more philosophical sense.

“It all comes down to democracy,” he said. “You get fragmented by local control, and the greater good is sacrificed.”

American parks have traditionally been open to everyone, said Jasper Rubin, an assistant professor of public affairs and civic engagement at San Francisco State University, where he researches planning and urban public spaces.

“It’s certainly not within the tradition of parks, at least in the 20th century,” he said. “It seems perhaps a little mean-spirited, but whether it’s ethically questionable, I don’t know. If the goal is to keep out other people who don’t have another park to go to, it would be exclusionary.”

Regardless of accusations of racism, elitism and intentional exclusion, Palo Alto officials don’t seem inclined to take up the matter in the immediate future.

“It’s a historical decision that was made in the late ’50s that just hasn’t changed over time,” O’Kane said. “It’s not based on wanting to exclude anyone; it’s based on wanting to give residents first priority to access while maintaining the ecological sustainability of the park.”

Michael Cabanatuan is a San Francisco Chronicle staff writer. Email: mcabanatuan@sfchronicle.com Twitter: @ctuan