UPDATE, 10/9/12, 6:30 p.m. EDT: The names of Frost Brown Todd attorneys working on the matter have been added to the fifth paragraph.

British oil giant BP said Monday it has agreed to sell its Texas City, Texas, refinery and a portfolio of related infrastructure to Marathon Petroleum Corporation in a deal that could eventually be worth up to $2.5 billion.

Findlay, Ohio–based Marathon will pay $598 million in cash, with hydrocarbon inventories valued at roughly $1.2 billion also changing hands in the deal. The transaction also calls for Marathon to pay BP up to $700 million over a six-year period based on earnings tied to the refinery. In addition to the Texas City refinery, Marathon will acquire three natural gas pipelines, four terminals, and an energy production facility, along with various other related assets. The deal is expected to close by “early 2013,” pending regulatory approval, according to BP’s announcement.

The Texas City facility, one of the largest in the United States, produces 451,000 barrels of oil per day. Marathon, which currently operates an 80,000-barrel-per-day refinery in Texas City, would become the fourth-largest U.S. refiner with the acquisition, according to Reuters. Marathon is currently the fifth-largest refiner in the country after being spun off from Marathon Oil last year.

Marathon has enlisted the legal services of Jones Day in connection with the acquisition. Houston-based energy partner Jeffrey Schlegel is leading the firm’s team, which also includes intellectual property partner Joseph Beauchamp, tax partner Todd Wallace, M&A partner Peter Izanec, restructuring partner Thomas Howley, business and tort litigation partner Scott Cowan, finance partner Robert Graves, and health care partner John Bibby. Other attorneys advising include: real estate partners Michelle Brown, Susan Cox, and David Lowery; energy partners Kenneth Driver, Gerald Farano, Fritz Henze, Dickson Chin, and Charles Wehland; antitrust partners Tom Smith, Peter Love, and Fiona Schaeffer; and labor and employment partners Mark Temple and Brian Easley.

Frost Brown Todd is providing Marathon with advice on environmental law aspects of the transaction, with a team that includes environmental chair Kevin McMurray and environmental member Steven Wesloh.

Group counsel Michael Barnett is leading Marathon’s in-house legal team.

Kirkland & Ellis and Vinson & Elkins, meanwhile, are providing legal advice to BP on the sale. Kirkland’s team includes corporate partner Michael Woods and antitrust partners Ian Conner and Bilal Sayyed. V&E’s team includes M&A partner Chris Collins, real estate partner Sandy Weiner, and environmental partner Carol Dinkins.

Both firms have a history advising BP, with both counseling the British company on the numerous claims brought against BP in connection with the 2008 Deepwater Horizon oil spill. In order to pay off the damages from that disaster, BP has set a goal of shedding $38 billion in asset by next year. BP said in its announcement that with the sale to Marathon, the company has hit the $35 billion mark.