BP is close to reaching its $38bn disposals target after selling its Texas City refinery, where 15 people died and 170 were injured in an explosion in 2005, to Marathon Petroleum for $2.5bn (£1.55bn).

The sale brings to an end a sorry chapter in BP's history: it had to pay $13m in July to settle 409 safety violations found by the US Occupational Safety and Health Administration following the disaster, which was the worst industrial accident in the US for a generation. It happened when workers overfilled a container with volatile chemicals, sparking an explosion.

The settlement removed a major hurdle for the disposal of the refinery, which turns 475,000 barrels of oil a day into petrol and jet fuel. Two years ago, BP was fined a record $50.6m for failing to fix hazards at the site south-east of Houston, Texas, and agreed to spend at least $500m on safety improvements. BP said it paid out well over $2bn in civil claims, fines and penalties relating to the 2005 explosion.

Texas City refinery manager Keith Casey said the site had been transformed through an increased focus on safety and in recent months returned to profitability. "It does not, however, fit with the long-term strategic direction of BP's global refining portfolio," he said.

The sale price is made up of $600m in cash, $1.2bn for inventories and $700m that Marathon will pay BP over the next six years in an "earn-out" arrangement based on the refinery's future operation and margins.

The 2,200 people working at Texas City are expected to transfer to the new owner, a "downstream" company (ie involved in selling and distributing natural gas and crude oil products) which already has a small refinery in Texas City.

BP initially embarked on a $23bn selling spree to raise cash for liabilities and fines after the Deepwater Horizon oil spill in the Gulf of Mexico in 2010, then last year it raised the target amount it wanted to raise from selling "non-core" assets to $38bn.

The sale of the Texas City refinery, which also includes liquified natural gas pipelines and four marketing terminals in the south-east US, comes after the recent offloading of BP's Carson refinery in California and brings the total disposals to $35bn.

BP has been keen to scale down its refining operations, where profit margins are thin. The company is confident of reaching its $38bn target by the end of next year, although it has not hoisted the "for sale" sign over any other assets.

BP took a $38bn charge related to the Gulf of Mexico disaster. So far it has spent $14bn cleaning up the oil spill; paid out more than $8bn in claims; and agreed a settlement with the Plaintiffs Steering Committee – which represents affected individuals and small businesses – which is expected to cost the company another $8bn.

The US department of justice has said it expects to find BP guilty of gross negligence in a court case which restarts in January. If the government can prove gross negligence it can triple the damages BP may have to pay to $21bn.

"Today's announcement is the second major milestone in the strategic refocusing of our US fuels business," said Iain Conn, chief executive of BP's global refining and marketing business. "Together with the sale of our Carson, California refinery, announced in August, the divestment of Texas City will allow us to focus BP's US fuels investments on our three northern refineries."

The energy giant sold its Carson refinery to Tesoro for $2.5bn but is investing heavily in three core US sites: Whiting in Indiana, Cherry Point in Washington and Toledo in Ohio. Last month it disposed of oil and gas fields in the Gulf of Mexico to Plains Exploration for $5.5bn.