* Marathon to purchase refinery for $598 million
* Inventory worth around $1.2 billion
* Marathon shares soar, analysts see deal priced cheaply
(Updates with detail, background)
By Kristen Hays
HOUSTON, Oct 8 (Reuters) - Marathon Petroleum Corp struck a deal to buy BP Plc's Texas City refinery and related infrastructure for up to $2.5 billion, a purchase that will make Marathon the fourth-largest U.S. refiner and give it a bigger potential slice of the market for refined product exports.
Marathon said on Monday it had agreed to buy the 451,000-barrels-per-day refinery, the fifth-largest in the country, as well as the plant's inventory, three intrastate natural gas liquids pipelines, four terminals and other assets.
The news sent shares in Marathon to a record high of $60.04 on the New York Stock Exchange. Since the stock began trading in June 2011, it has risen nearly 50 percent.
The base purchase price is $598 million, plus inventories estimated at $1.2 billion, Marathon said.
The agreement also contains a provision to pay up to $700 million more over six years, depending on the refinery's profitability.
"The multiple is cheap, that's why the shares of Marathon are up," said Pavel Molchanov, an analyst with Raymond James. "Texas City has a rather complicated history and that alone has made the valuation of this deal lower than it would have been otherwise."
For factbox on Marathon's refining operations, click on .
The Texas City refinery was the site of a 2005 explosion, one of the worst industrial accidents in U.S. history. The blast killed 15 workers, injured 180 others and cost BP more than $3 billion to settle lawsuits and pay fines.
In March, BP exited a three-year probation term stemming from the explosion, and in July the company agreed to pay $13 million to settle most post-blast safety violations at the plant.
With the $700 million earn-out arrangement, the deal's valuation is $1,880 per barrel of refining capacity and $328 per barrel without it, Molchanov said. A more typical valuation in recent deals has been $2,000 per barrel, Molchanov said.
The deal brought together a motivated seller and an opportunistic buyer, said Fadel Gheit, an analyst with Oppenheimer & Co.
"This is absolutely the best thing they have done since they became a public company," Gheit said, referring to Marathon's spinoff from Marathon Oil Corp last year.
BP said the sale, expected to close early next year, would bring its divestments since 2010 to $35 billion as it sheds assets to focus operations better and pay the costs of its disastrous 2010 oil spill in the Gulf of Mexico.
The transaction, seen boosting earnings in the first year of operation, is expected to be funded with cash on hand, Marathon said.
Marathon Chief Executive Gary Heminger has consistently said the company was interested in acquisitions that gain assets beyond just a refinery, such as pipelines, terminals and supply contracts with service stations that work together in an integrated system.
"What I've always said in the past is that we are only interested in a system. By that I mean some pipelines, some retail or wholesale that goes with the refinery," Heminger told Reuters in an interview earlier this year.
The BP deal provides those extras. In addition to the refinery, Marathon will acquire BP's access to the Colonial Pipeline, the nation's largest oil product pipeline; four product terminals in Florida, North Carolina and Tennessee; retail marketing contracts to supply about 1,200 branded sites in the southeastern United States; and a 1,040-megawatt cogeneration facility on the refinery site.
EYE ON EXPORT MARKET
Also, Marathon can increase refined product exports to Latin America and Europe, as it has with its 490,000-bpd refinery in Garyville, Louisiana. That refinery exported 110,000 bpd of products, mostly diesel fuel, in the second quarter this year, which executives said was its "reasonable maximum".
The Texas City plant does not export products under BP's ownership, but it could with investment in docks, storage tanks and pipelines.
Heminger said in a statement on Monday that the deal can "enhance our ability to sell products into export markets".
So far this year, U.S. fuel exports have nearly doubled versus year-ago levels to about 2.85 million bpd, according to U.S. government data, as domestic demand declines and refiners look to foreign markets to bolster profits.
Marathon has a small, 80,000-bpd refinery in Texas City that processes light-sweet crude and has benefited from burgeoning sweet crude output from the Eagle Ford shale play in south Texas. The BP Texas City refinery can process various kinds of crude, from light-sweet to heavy sour.
BP will keep the Texas City complex's chemical plant.
John Auers, senior vice president with refinery consulting firm Turner, Mason & Co, said sellers typically keep responsibility for outstanding liabilities when selling assets, but prior settlements with U.S. safety regulators had cleared the way for a sale.
"It's always better to close it up as much as possible and BP was trying to do that," Auers said. "They're trying to make it as clean a sale as possible."
(Additional reporting by Steve James and Michael Erman in New York and Anna Driver in Houston; Editing by Dale Hudson, Leslie Adler, Maureen Bavdek and Chris Baltimore)