Saudi Aramco will pay Shell $2.2bn (£1.8bn) to finalise the split of a refining joint venture between the two firms.
After the split, the Saudi oil giant's refining unit will wholly own Motiva Enterprises as well as the Port Arthur, Texas refinery - the largest in the US, which produces 600,000 barrels per day - and 24 distribution terminals.
"Our longstanding investment in the United States is continuing to evolve and strengthen. We view this transaction as a positive outcome of the strong and historic business of Saudi Aramco in the US." said Amin Nasser, President and chief executive.
The breakup of the two-decade-old joint venture is subject to adjustments including working capital, Shell said. Saudi Aramco will pay $2.2bn, including assuming Shell's $1.5bn share of net debt.
At the end of 2016, the joint venture's net debt was $3.2bn, and Shell will assume $100m.
Shell said the transaction is expected to be completed in the second quarter of 2017.
Dan Romasko, Motiva's President and chief executive, said: "In preparation for transaction close, we are working diligently on two fronts – delivering on our 2017 business plan and preparing the company for a successful transition to stand-alone operation."
Nasser added Saudi Aramco will provide Motiva with "strong" financial support and necessary liquidity needed to maintain an investment grade credit rating and capitalise on growth and expansion opportunities.
Analysts at RBC Capital said: "The transaction value is 10 per cent higher than we had forecast, however with the cash portion slightly below our expectations. On our numbers, we see Shell cashing in $1.1bn of divestments in the first quarter (mainly Bongkot), and $1.2bn of divestments in the second quarter (Australia aviation, Vivo Energy, Motiva), which should help reduce gearing and reduce concerns around the dividend. "