Royal Dutch Shell RDS.A -2.16% PLC has agreed to sell all of its assets in the Permian basin, the most active U.S. oil field, to ConocoPhillips COP -3.14% for around $9.5 billion in cash.

The deal, disclosed by both companies on Monday, comes as Shell is attempting to cut its carbon emissions and invest more in renewable energy. The sale is one of the largest recent transactions in the shale patch as large oil companies come under increasing pressure to diversify outside of fossil fuels.

The Wall Street Journal reported earlier Monday that such a transaction was imminent.

Shell said $7 billion of the proceeds will be returned to shareholders, while it will use the remainder to shore up its balance sheet. The European oil giant had acquired the bulk of its Permian assets in 2012 from Chesapeake Energy Corp. for about $1.9 billion.

ConocoPhillips said the assets, entirely in Texas, included about 600 miles of oil, natural-gas and water pipelines and other energy infrastructure. It declined to comment further on the deal Monday.

The U.S. has more than doubled its crude output over the last decade. Much of the growth is due to the Permian Basin of West Texas and New Mexico. WSJ traces the hot spot of North America’s crude oil boom, with a look at challenges that producers in the region face. (Video from 6/27/19)

Shell found that divesting the asset was a more attractive option for its shareholders than acquiring additional assets to grow its footprint in the Permian oil field, which straddles Texas and New Mexico, said Wael Sawan, Shell’s upstream director, in an interview.

“We found the cost of acquisitions in the last few years was above what we felt was going to be value-accretive for our shareholders,” Mr. Sawan said.

Mr. Sawan said the $7 billion that Shell plans to return to shareholders will most likely occur in the form of share repurchases, though that will be determined by the company’s board when it closes the deal in the fourth quarter.

Shell has about 225,000 net acres in the Permian that produce about 175,000 barrels of oil equivalent per day. The Permian represented less than 1% of the company’s carbon emissions from operations, Mr. Sawan said.

Shell said most of its workers in Midland, Texas, the heart of the Permian, and many of its employees in Houston will join ConocoPhillips, which is based in Houston.