Houston-headquartered Targa is spending $5.8 billion on Atlas Pipeline Partners and a further $1.869 billion on the to-be-spun-off midstream assets of Atlas Energy.

Offshoot Targa Resources Partners is taking Atlas Pipeline Partners in a cash-plus-shares deal valuing the latter’s shares at $38.66 each. The $5.8 billion price tag includes $1.8 billion in debt.

In the other transaction, Atlas Energy is to spin off its midstream assets into a separate entity that will be acquired by Targa.

The