BP could soon run out of cash in the compensation fund set up for victims of the Deepwater Horizon disaster, unless it is successful in a legal challenge that will be heard in court next week.

The company has been fighting the compensation formula drawn up to pay businesses and individuals harmed by the 2010 spill, ahead of a court hearing in New Orleans on July 8.

Court-appointed claims administrator Patrick Juneau has processed about a quarter of the 194,800 claims received, and made compensation offers worth about $3.86bn, almost half the $8.2bn that BP had expected for the total cost of the settlement with the plaintiffs' steering committee (PSC).

BP has been paying compensation from a $20bn fund set up in 2010 and had already committed $18.3bn to pay claims by the end of March, leaving $1.7bn. At the current rate of spending the money could run out by September, according to a report in the Financial Times.

The company is legally committed to paying compensation, even if its fund runs out. The oil firm gave up control over the compensation formula and framework for payments to claimants in a legal settlement. But it has since gone on to dispute – so far unsuccessfully – how that formula is being applied.

Last month, BP took out ads in the New York Times, Wall Street Journal and Washington Post promising to pay all "legitimate claims" to businesses and individuals harmed by the spill, but claiming that it was being forced to hand out funds to parties that don't deserve the money. The company said that without relief it could be "irreparably harmed" by payouts.

"Trial lawyers and some politicians are attempting to capitalise on this misinterpretation by encouraging the submission of thousands of claims for inflated losses, or losses that do not even exist," BP said in its advertisement.

"Whatever you think about BP, we can all agree that it's wrong for anyone to take money they don't deserve. And it's unfair to everyone in the Gulf – commercial fishermen, restaurant and hotel owners, and all the other hard-working people who've filed legitimate claims for real losses."

BP is currently embroiled in a two-part court case in New Orleans with the US government that aims to settle the extent of its liabilities for the deadly disaster. The first phase, to establish whether or not the company was grossly negligent or not, has ended. Judge Carl Barbier will begin hearing phase two in September and will determine how much oil was spilt in the disaster. The extent of BP's negligence and the amount of oil spilt will determine the eventual fine.