Image copyright AP Image caption The Petrobras scandal has sparked protests against the Brazilian President

Brazil's state-run oil company, Petrobras has taken a $2bn (£1.3bn) charge for costs related to corruption.

The company has published accounts for last year showing an overall loss of $7.2bn.

The company's results also included an impairment charge of $14.8bn reflecting the decreased value of its assets.

Petrobras has been embroiled in a massive corruption scandal in which it is alleged that bribes were paid for lucrative contracts with the firm.

The scandal has hurt Petrobras and damaged President Dilma Rousseff's government.

Political fallout

In March hundreds of thousands of Brazilians protested against President Rousseff, who chaired the board of Petrobras for much of the period when the alleged bribes happened.

However, the president denies involvement and has been exonerated by an investigation by the attorney general.

More than 40 top politicians - including the presidents of both houses of Congress - are still under investigation, and the treasurer of the country's ruling party has been arrested.

Image copyright Reuters Image caption Former Petrobras supply director Paulo Roberto Costa (left) has been convicted

Earlier on Thursday a judge convicted a former Petrobras executive of money laundering and racketeering for his role in the case, that involved bribes and illegal donations to political parties.

Paulo Roberto Costa, who was head of refining and supply, will serve part of his sentence under house arrest. He can still appeal.

Analysis: Daniel Gallas, South America business correspondent

Petrobras was supposed to be Brazil's "lottery ticket" - as it is sitting on top of one of the world's most valuable oil reserves.

But today it announced losses of $7bn for 2014 - its first loss in decades.

That number is based on witness statements to the police that 3% of each major contract between 2004 and 2012 was paid in kickbacks to politicians and executives.

Wednesday's announcement was highly anticipated in Brazil and in the markets, because previous figures were discredited.

Petrobras executives - all recently appointed to replace people involved in the scandal - hope this will draw a line, and that the company may finally start to move on.

Petrobras's oil bonanza: Blessing or curse?

Back in November Petrobras's auditors PricewaterhouseCoopers (PwC) declined to certify the company's accounts saying that the corruption scandal made it hard to value the firm's assets.

Since then PwC has been able to calculate the impact of corruption and also identified other costs including those related to missed production targets and the lower price of crude oil.

Publishing the results "is a fundamental step toward fully salvaging the company's credibility," said Aldemir Bendine, the firm's new chief executive.

But analysts say that the company will have to work hard to regain the trust of the financial markets.

"Petrobras's problem isn't about oil or finance, it's about trust. The first thing the company needs to do is recover its credibility, because today the market doesn't believe it," said Daniel Marques, chief analyst at consulting firm Gradual Investimentos.