U.S. petroleum and natural gas exploration and production company Anadarko Petroleum Corp announced that it would sell nearly all of its midstream assets, including pipelines, to midstream energy assets developer Western Gas Partners for $4.02 billion.

Anadarko Petroleum is selling assets in the Permian basin in Texas and New Mexico and the Julesburg Basin in Colorado.

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

The sale is expected to close in the first quarter of 2019.