Energy Transfer Partners LP, owner of more than 17,500 miles of natural-gas pipelines, agreed to buy Sunoco Inc., for $5.3 billion, adding oil terminals and transportation assets.

Sunoco holders will receive about $50.13 a share, consisting of $25 in cash and 0.5245 common units of Energy Transfer, according to a joint statement Monday. Dallas-based Energy Transfer is paying a 23 percent premium above the April 27 closing price for Sunoco. That’s less than the 48 percent average premium of 97 deals in the pipeline sector in North America in the past 12 months, according to data compiled by Bloomberg.