BP posted higher than expected profits in the final three months of last year even as Europe's second biggest oil producer paid out tens of billions of dollars in fines and costs associated with the fatal Gulf disaster in 2010.

Profits for the three months ending in December fell to $3.984bn, the company said in a statement published on its website, from $4.986bn during the same period last year. A poll of analysts conducted by Thompson Reuters suggested a figure of $3.305bn. For the full year, so-called replacement cost profits were $17.6bn, a 19 percent decline from 2011. The company said it took a $4.1bn charge to it quarterly earnings as a result of its recent criminal settlement with the US Department of Justice.

"We have moved past many milestones in 2012, repositioning BP through divestments and bringing on new projects. This lays a solid foundation for growth into the long term," said CEO Bob Dudley in the statement. "Moving through 2013 we will deliver further operational milestones and remain on track for delivery of our ten-point strategic plan, including our target for operating cash flow growth, by 2014."

BP will pay a quarterly dividend of $0.09 per share next month, the company said.

BP reached a deal with US prosecutors last week for its role in the fatal Deepwater Horizon explosion in the Gulf of Mexico that will see it pay the largest criminal fine in US history.

U.S. District Judge Sarah S. Vance agreed to accept BP's guilty plea to 11 felony counts related to workers' deaths as well as a felony related to obstruction of Congress and two related misdemeanours after a hearing Tuesday in New Orleans. BP will also pay a record $4bn fine and face five years of probation for its role in the blast and the spill the followed.

The fine includes $1.25bn in criminal penalties, $2.4bn owed to the National Fish and Wildlife Foundation, a $525m civil penalty to the Securities and Exchange Commission and a $350m payment to the National Academy of Science. The total sum of $4.5bn will be paid over five years, the US District Court for the Eastern District of Louisiana was told Tuesday.

"BP continued to work through the legal proceedings in the US during 2012, completing payments into the Trust Fund, and agreeing settlements with the Plaintiffs' Steering Committee, criminal settlement with the US Department of Justice and settlement of civil claims against BP with the Securities and Exchange Commission," the company said. "Primarily reflecting the criminal settlement agreement with the DOJ, BP took an additional $4.1bn charge in the fourth quarter. The total cumulative net charge for the Gulf of Mexico incident at the end of the year was $42.2bn."

BP remains prepared to settle the remaining civil claims but only on reasonable terms, and continues to prepare for the civil trial scheduled to start in late February.

The Deepwater Horizon rig exploded on 20 April 2010 as it was drilling for oil in the mile-deep Macondo well in the Gulf of Mexico. The blast killed 11 workers on the rig, which was operated by Switzerland's Transocean Ltd, and eventually led to the spillage of nearly 5 million barrels of oil into the Gulf, affecting fish, wildlife and businesses from Texas to Florida.

BP agreed to pay $7.8bn last year to cover the economic, property and pollution-related damages linked to what has been called the worst environmental disaster in US history.

A separate civil case, various State claims and alleged violations of the US Clean Water Act, which are still to be litigated, could cost the group a further $21bn.

Transocean agreed on 3 January to pay $1.4bn in civil and criminal penalties for its role in the disaster after reaching an agreement with the US Department of Justice. The group said at the time it will plead guilty on 4 February to one misdemeanor violation of the Clean Water Act and accept five years' probation.

BP shares rose around 0.9 percent to change hands at 466.3 pence each in the opening minutes of trading in London.