Working to lock in environmental protections as the clock runs out on his presidency, President Barack Obama on Friday released a plan for offshore oil drilling in federal waters that bans until 2022 any new drilling off the coasts of California, Oregon or Washington.

The move puts up a roadblock to President-elect Donald Trump, who has vowed to expand offshore oil and gas drilling.

U.S. Interior Secretary Sally Jewell said the decision “is consistent with the longstanding position of the Pacific coast states in opposition to oil and gas development off their coasts.”

The decision, a rule that outlines which offshore areas will be open for leasing by oil companies from 2017 to 2022, also blocked new oil drilling in federal waters off the Atlantic coast and in the hotly contested Arctic Ocean north of Alaska in the Chukchi and Beaufort seas. It allowed oil companies to bid for 10 lease sales, however, in the Gulf of Mexico and one off the Alaska coast at Cook Inlet, southwest of Anchorage.

Conservation groups expressed delight.

“The removal of our waters from offshore drilling plans is paramount to protecting coastal communities in Alaska and across the Eastern and Western seaboards,” said Michael Brune, national executive director of the Sierra Club. “The actions taken today by the Obama administration recognize this.”

The oil industry and its allies in Congress reacted with anger.

“Today’s plan will chart a path of energy dependency for decades to come,” said Rob Bishop, R-Utah, chairman of the House Natural Resources Committee. “We should be building on our position as a global energy leader, but we are punting it to Russia as Obama appeases the environmentalists pulling his strings.”

Trump hasn’t yet chosen an interior secretary, the nation’s top official to oversee public lands such as national parks and wildlife refuges, along with offshore oil policy. Some of those rumored to be under consideration are former Alaska Gov. Sarah Palin, former Arizona Gov. Jan Brewer, Oklahoma fracking billionaire Harold Hamm, Lucas Oil CEO Forrest Lucas of Indiana and Richard Pombo, a former Republican congressman from California’s Central Valley.

Under Friday’s announcement, the federal government will now hold a 60-day public comment period. It will end before Trump takes office on Jan. 20, which will make undoing Obama’s action complicated.

Any attempt to revoke Obama’s decision would likely require new rounds of public hearings, studies and analysis under federal law — and would be met with lawsuits by environmental groups.

“It would be a lengthy and litigation-prone process. It could be in court longer than Trump is in the White House,” said veteran coastal activist Richard Charter of Bodega Bay, a senior fellow with the Ocean Foundation.

California is the nation’s third-largest oil producing state, behind Texas and North Dakota. There are 32 offshore platforms and artificial islands where oil is produced, all located in Southern California off the Santa Barbara, Ventura, Los Angeles and Orange county coasts. They date back to the 1950s, and no new ones have been constructed in more than 30 years.

Although Republican administrations in decades past have pushed for new offshore drilling off the California coast, Democrats in Congress have blocked it. During the 1980s, President Ronald Reagan and his interior secretary, James Watt, pushed to open areas off Big Sur, the San Mateo County coast and the Sonoma County coast to new oil drilling. The proposals were met with walls of protest from environmentalists, the fishing industry and tourism leaders.

Congressional leaders led by former Monterey Democratic Rep. Leon Panetta blocked the drilling by imposing an annual moratorium on the Interior Department budget, banning the agency from spending any money to pursue offshore lease sales. Eventually, President George H. W. Bush, seeking to win California as part of his 2012 re-election campaign against Bill Clinton, established the Monterey Bay National Marine Sanctuary, which prohibited oil drilling from Hearst Castle to the Marin Headlands.

Last year, Obama enlarged another sanctuary, the Gulf of the Farallones. So oil drilling is now banned from Hearst Castle to Point Arena in Mendocino County. But oil companies in past years have expressed interest in drilling off Humboldt County, Santa Monica, La Jolla and other places not included in marine sanctuaries.

On Wednesday, the six U.S. senators representing California, Oregon and Washington — all Democrats — sent a letter to Obama asking him to permanently ban new offshore oil drilling in federal waters off their states by executive order.

After the 1969 Santa Barbara oil spill, when a Union Oil platform dumped more than 3 million gallons into the ocean, killing thousands of seabirds and other marine animals, President Richard Nixon and his interior secretary, Walter Hickel, established the “Hickel Preserve,” a 34,000-acre area off Santa Barbara where oil drilling was permanently banned.

Charter said Friday that although Trump could overturn such an action, it would take years of lawsuits, further slowing the industry’s efforts.

Ironically, U.S. oil production during Obama’s tenure has been at record levels. Largely because of advances in fracking technology on land, American oil production grew from 5.1 million barrels a day when Obama took office in January 2009 to 8.9 million barrels a day by last April, a 74 percent increase. Last year, U.S. oil production was at a 43-year high.

But Obama has also imposed sweeping regulations on the oil industry, including a slowdown on offshore drilling in the Gulf of Mexico after the Deepwater Horizon spill in 2010. The president has also doubled U.S. gas mileage standards to a fleet average of 54 mpg by 2025 and imposed climate change rules to require power plants to emit fewer greenhouse gas emissions, which would lessen demand for coal.