Sunoco (SUN) inked a $5.3 billion takeover on Monday from pipeline operator Energy Transfer Partners (ETE) that values the independent refiner at a 22.5% premium.

Under the terms of the transaction, Energy Transfer Partners will pay $50.13 in cash and stock to acquire Philadelphia-based Sunoco.

ETP said it anticipates the acquisition closing in the third or fourth quarter and adding to its bottom line immediately.

The deal "represents the next step in Energy Transfer Partners’ transformation into a more diversified enterprise with an integrated and expanded footprint,” ETP CEO Kelcy Warren said in a statement.

After the deal closes, ETP said Sunoco’s logistics and retail businesses will remain headquartered in the Philadelphia area.

Sunoco Logistics Partners (SXL) will continue to be listed on NYSE Euronext’s (NYX) Big Board as a separate publicly traded company, but ETP will acquire Sunoco’s general partner interest, limited partner interest and incentive distribution rights in the logistics company.

Despite the transaction, Sunoco said it will continue its plan to exit the refining business, perhaps through a proposed joint venture being negotiated with private-equity giant the Carlyle Group.

“This transaction will enable Sunoco’s businesses to realize their full potential by becoming an important part of a diversified leader in the energy industry,” said Sunoco CEO Brian MacDonald. “ETP recognizes that the steady, ratable cash flows that our logistics and retail businesses generate are backed by great assets, deep expertise, and the potential for future growth.”

Shares of Sunoco leaped 20.51% to $49.31 Monday morning, while ETP was up 1.19% to $48.49. Sunoco Logistics Partners saw its shares fall 0.81% to $40.66.

Wells Fargo (WFC) advised ETP on the transaction, while Credit Suisse (CS) served as Sunoco’s financial advisor.

Follow Matt Egan on Twitter @MattMEgan5