For years they have been at loggerheads, but in a deal thrashed out with environmental groups, a Houston oil company has agreed to shut down its offshore oil production off Santa Barbara County decades early in exchange for approval this year to drill into untapped undersea reserves.

To sweeten the deal, Plains Exploration & Production Co, known as PXP,  also has agreed to donate thousands of acres for public parkland. It would also pay millions to fund projects that offset carbon dioxide emissions, such as low-emission public buses.

Steve Rusch, a PXP vice president, said the company was willing to make concessions because it wanted to do more than simply neutralize offshore oil’s traditional opponents — it wanted to enlist their support. Since the 1980s, most offshore oil development in California has been met with fierce opposition, including protracted litigation, congressional moratoriums and bureaucratic delays.

So beginning later this month, local green groups will support PXP in its petition to use “slant drilling” from one of its four offshore platforms to tap into an undersea oil field, the Tranquillon Ridge, that could yield as much as 200 million barrels of oil and 50 billion cubic feet of natural gas.

It will be the first time in 39 years that one local group with a great acronym, Get Oil Out, or GOO, has supported oil drilling. Abe Powell, president of GOO, said it took “blood, sweat and tears” for his board members to abandon their historic role. “Once we realized that we had put together a good deal for the community, we got it together,” he said.