Trestles was saved Thursday and will be for the foreseeable future.

After 15 years of contentious negotiations – which brought thousands of people to drawn-out public meetings, sparked lawsuits and countersuits and led to countless “Save Trestles” bumper stickers – a deal was announced Thursday that ensures the iconic surf spot won’t be wiped out by a toll road.

The deal involves the key players: Orange County’s toll road agency, a coalition of environmental groups and the state attorney general. In addition to protecting Trestles, saying the 241 toll road won’t be extended to its border, the deal also protects San Onofre State Beach.

The agreement, approved by the Foothill/Eastern Transportation Corridor Agency Board on a 10-2 close session vote and announced outside the offices shortly after, specifically settles five lawsuits brought by the Save San Onofre Coalition and the attorney general. Those challenged the agency’s 2006 so-called Green Alignment and the 2013 approvals of its Foothill-South and Tesoro Extension projects.

The state beach, the Richard and Donna O’Neill Conservancy and surrounding open space and the wildlife habitat in the San Mateo Creek and watersheds all will be permanently protected from toll roads agency-sponsored projects. That includes the world-renowned surfing spot Trestles, a cobblestone beach that sits within San Onofre State Beach.

In exchange, the toll road agency will be allowed to explore other routes to extend the 241.

“This settlement gave us what we’ve been fighting for all along,” said Elizabeth Goldstein, president of the California State Parks Foundation and spokeswoman for the Save San Onofre Coalition of 12 California and national environmental organizations. “We achieved that; otherwise, we would not have signed it.”

The toll road fight dates back to the early 2000s, when the TCA announced a plan to extend the 241 toll road through San Onofre State Park.

That idea rankled many, including the surf community, as surfers came to believe one of the world’s most pristine breaks could be threatened by an extension of the toll road.

“We, as a group of surfers, really grabbed ahold of this. We made it cool and sexy and we made it our fight,” said Rick Erkeneff, president of the South County Surfrider Foundation. “We brought in heavy hitters like the Sierra Club and other environmental groups, these die-hard environmental organizations. And we stood arm in arm and we said, ‘No, we’re not going to allow this.’”

At one 2008 meeting, thousands packed the California Coastal Commission and testified for nearly 12 hours.

The agreement doesn’t mean a toll road isn’t coming to the area. Traffic on I-5 remains congested, and the toll road is sold as an alternative that could reduce congestion. But if one is built, or if the 241 is extended, it won’t be allowed to threaten Trestles or the San Mateo Watershed.

“We reached this decision through each party’s deep respect for one another’s priorities and objectives,” said Craig Young, chairman of the Transportation Corridor Agency.

“This settlement represented a win for both our region’s transportation needs and our region’s environmental priorities.”

It wasn’t just a one-sided win, Erkeneff said. The toll road agency got a promise that the Save San Onofre Coalition won’t challenge future plans for a toll road extension as long as it doesn’t encroach environmentally sensitive areas.

“The (TCA) wanted to put it to bed … They realized we were never going to go away, we were never going to stop fighting,” Surfrider’s Erkeneff said. “That’s what they got out of it. And we effectively saved Trestles, forever.”

At least 16 proposed plans have been brought forward by the public at two meetings, according to TCA spokesperson Kelsey Eiben. Any plan would need to go through environmental studies, community outreach and approvals.

One proposal calls for extending the toll road through the east side of San Clemente, Erkeneff said. Another might connect a northern stretch of Ortega Highway to I-5.

“This agreement reflects this new thinking on their part that they want to look at these other options,” said Dan Silver, executive director of the Endangered Habitats League.

In addition to wiping out the plans struck in 2006 and ’13, the deal announced Thursday pays about $7 million in legal fees to environmental groups. Also, the TCA agreed to create a $28 million conservation fund that will help restore the San Mateo Creek and its watershed, which could lead to the restoration of the southern steelhead trout population. An oversight committee will be part of the habitat restoration projects.

Projects that could be funded through the settlement include land acquisitions, restoration or removal of exotic vegetation and cleaning up the water.

Environmental groups may partner with other agencies to add money to the fund.

“The San Mateo Creek is a very special watershed,” Silver said. “It’s the only remaining undammed watershed in this part of California.”