Oil and gas producer Anadarko Petroleum Corp. (NYSE: APC) said on Nov. 8 it would sell nearly all of its midstream assets, including pipelines, to its master limited partnership Western Gas Partners for $4.02 billion.

The company is selling assets in the Permian Basin in Texas and New Mexico and the Denver-Julesberg Basin in Colorado.

Western Gas will take complete ownership of DBM Oil Services, and APC Water Holdings, while acquiring a 50% stake in multiple gas plants in the Delaware Basin of West Texas, the companies said.

The sale is expected to close in first-quarter 2019.