LONDON, March 17 (Reuters) -- The breakup of Royal Dutch Shell's and Saudi Aramco's giant US refining joint venture draws a line under an often rocky relationship and allows Aramco to accelerate an ambitious public offering and Shell to push ahead with a large asset sale.

The two energy giants' plan to dissolve Motiva Enterprises after a near 20-year partnership leaves both with fully-owned refineries and gas stations in the US.

Refineries have recently enjoyed a boom time as a near 70% plunge in oil prices since mid-2014 spurred demand for gasoline from around the world, helping many oil companies recover revenue lost from oil production.

"The deal gives both companies a lot of flexibility," said Jason Gammel, an analyst at Jefferies.

Saudi Arabia's oil champion Aramco, which will own the largest US refinery in Port Arthur, Texas, and retain 26 distribution terminals, could fold the assets into one global refining subsidiary in which it is considering selling a stake, industry sources said.

The giant refining group would most likely comprise of Aramco's domestic refineries, including its joint refinery with Shell in Jubail known as SASREF, as well as its overseas plants in China and South Korea, sources said.

Aramco, the world's largest oil company, has said it was considering options including a stock market listing, and possibly including downstream assets.

The Motiva breakup will also give Aramco full control over which feedstock to use at the Port Arthur refinery, which has been a sticking point in recent years as rising US shale oil production displaced imported Saudi crude to the detriment of Aramco's strategy of increasing overseas market share.

Sadad al Husseini, a former senior Aramco executive, said the move is in line with its plans to maintain market share and raise its refining capacity to 8-10 million bpd.

ASSET SALE

For Shell, being the sole owner of the Convent and Norco refineries in Louisiana as well as marketing operations in Florida, Louisiana and the Northeastern region offers an opportunity to sell assets as part of a $30 billion sale program over the next three years to pay for its $50 billion acquisition of BG Group last month.

CEO Ben van Beurden has said Shell's disposals would initially focus on the refining, storage and retail divisions, known as downstream, whose value has held up during the current downturn.

Aramco is expected to pay Shell an as yet undisclosed sum on the completion of the deal, a Shell spokesman said.

Although an outright sale of the refineries is less profitable, Shell will be able to offer for sale much of the infrastructure linked to the operations, including pipelines, storage tanks and distribution facilities, to other companies including Shell Midstream Partners, a master limited partnership (MLP) formed and listed by Shell in 2014.

"For Shell, a lot of assets are suitable for drop downs into the MLP and now that they have 100% ownership of the assets they can do it more easily," Jefferies' Gammel said.

He said the transaction also gave Shell higher production of gasoline, in particular high-value gasoline blendstock, which was the main driver in the global jump in fuel demand last year.

The Norco refinery's close integration with Shell's nearby petrochemical plant offers the Anglo-Dutch company further benefits, Gammel said.

(Additional reporting by Jessica Resnick-Ault in New York and Reem Shamseddine in Khobar, editing by David Evans)