BP Plc agreed to sell its entire business in Alaska to closely held Hilcorp Energy Co. for $5.6 billion, ending a six-decade presence in the state as oil production there declines.

The deal includes BP’s operating stake in Prudhoe Bay, the largest-producing oilfield in U.S. history, as well as all its Alaskan pipelines, London-based BP said Tuesday in a statement. For Hilcorp, the oil company founded by Texas billionaire Jeffery Hildebrand, it’s the largest acquisition in its history and adds to Alaskan assets bought from BP in 2014.

Alaska’s oil output has slumped from its heyday in the late 1980s as discoveries dried up and major producers sought easier-to-produce crude elsewhere, most recently from shale rock in Texas. Hilcorp, along with ConocoPhillips, is one of the few big oil companies still interested in investing fresh capital in the state, which is home to protected ecosystems.

“We are steadily reshaping BP and today we have other opportunities, both in the U.S. and around the world, that are more closely aligned with our long-term strategy and more competitive for our investment,” BP Chief Executive Officer Bob Dudley said in the statement.

The sale forms the majority of BP’s two-year, $10 billion divestment plan. It includes the stake in the Trans-Alaska Pipeline System which has been running below capacity for years as oil production in the state has declined. BP American depositary receipts rose as much as 1.1% in New York trading.

Hilcorp has been trying to build an artificial island off of Alaska’s coast to drill in the Beaufort Sea. In the last five years, it has bought more than $6 billion oil and gas assets, according to the company’s website. In 2018, the company produced about 108,000 barrels of oil equivalent per day of liquids and almost 209,000 barrels of oil equivalent per day of gas.

Statewide annual production peaked at 2 million barrels a day in 1988, the year before the Exxon Valdez oil spill. Last year, it averaged 479,000 barrels a day.

The U.S. Interior Department is preparing to sell drilling rights in the Arctic National Wildlife Refuge later this year. The refuge’s coastal plain, known as the 1002 area, is thought to contain billions of barrels of oil, but tapping it was off-limits for decades until 2017, when Congress ordered the government sell drilling rights there under the premise it would raise money to offset tax cuts.

BP was one of the original partners in building the 800-mile (1,300-kilometer) Trans-Alaska Pipeline System in 1977, designed to bring oil from the North Slope to the port of Valdez on Alaska’s southern coast. It was one of the largest privately funded construction projects in history. BP holds a 49% stake in the pipeline, with ConocoPhillips, Exxon Mobil Corp. and Unocal Pipeline Co. holding the remainder.