BP has won a partial victory in the US courts after a federal judge in New Orleans capped a potential fine for polluting the Gulf of Mexico in 2010 at $13.8bn (£9bn) rather than the feared $18bn. The exact scale of the financial penalty for causing the worst offshore pollution incident in American history will not be known for some time, but BP is confident it will be lower still.

BP has set aside only $3.5bn in its accounts to pay off the fine, and any figure in excess of this could force the company into selling off more assets to pay for it. But the London-based oil company’s shares rose 4% after it said in a statement: “BP believes that considering all the statutory penalty factors together weighs in favour of a penalty at the lower end of the statutory range.”

Judge Carl Barbier ruled late on Thursday in a New Orleans federal court that the Deepwater Horizon spill was 3.2m barrels, greater than the 2.4m barrels argued by BP but less than the 4.2m claimed by the US government. The decision leaves the oil group facing a maximum possible fine of $4,300 per barrel, or $13.8bn, under the Clean Water Act. This will be decided by a separate hearing to begin next week.

Barbier said BP’s response to the disaster was not grossly negligent, but stuck to an earlier judgement that the company was grossly negligent in the period leading up to the blowout of the Macondo well.

The judge also said there was no question that BP lied about the amount of oil that flowed from the well. The company told government officials the figure was 5,000 barrels a day when internal documents showed that officials knew the amount was significantly higher than this.

BP is still separately appealing in the courts against the gross negligence verdict and its lawyers are expected to argue for a small fine per barrel in the case beginning on Tuesday. The Clean Water Act penalties would come on top of more than $42bn that BP has set aside or spent for clean-up, compensation and fines.

Even after the Clean Water Act fines are set, BP may face other bills from a lengthy Natural Resources Damage Assessment – which could require the company to carry out or fund environmental restoration work in the Gulf – as well as other claims.

Iain Armstrong, equity analyst at Brewin Dolphin wealth management, expressed the views of many investors when he said: “We agree with BP that this ruling indicates that the cost of the penalty will be at the lower end of the statutory range. In summary, after a series of setbacks in the court, this is a positive outcome for BP.”

The Macondo well blowout spread oil over the beaches of southern states in America, but also spread a cloud over the finances and reputation of the group. The share price has never recovered fully, and BP has since been hit by other factors, notably its decision to take a 20% share in Russian state oil group Rosneft when it sold its share in its own Siberian business, TNK-BP.

The company, like the rest of the oil industry, is also currently being hit hard by plunging crude prices. On Thursday it announced the axeing of 300 jobs in Aberdeen, having earlier said it would set aside $1bn to downsize staff worldwide, and has said it believes crude prices will remain in the $50-$60-a-barrel range – compared with around $100 in 2014 – for as long as three years.

Meanwhile, Schlumberger, the world’s largest oil services business, spread the gloom on Friday by saying it was going to make 9,000 staff redundant globally.

The impact of falling oil prices on thousands of jobs and tax revenues have caused panic in the political establishment of both Westminster and Edinburgh.