The move was welcomed by investors but is likely to upset the federal government, as it is unpopular and brings renewed inflation fears just as the central bank started lowering interest rates.
Petrobras said in a statement it will raise average gasoline prices by 16.3% to 2.93 reais ($0.5893) per liter beginning Wednesday, while diesel prices will be increased by 25.8% to 3.80 reais per liter.
Shares in the company, which was under pressure to hike prices after operating at discounts to international rates for the past few weeks, jumped as much as 4.9% after the announcement.
"The price hikes are a clear positive for Petrobras," JPMorgan analysts said, noting investors lately had been worried about the discounts. "The hikes suggest that governance continues to work, which is certainly positive news."
The move, however, is likely to trigger an upward revision in inflation estimates, with the central bank saying its impact would amount to around 40 basis points between August and September.
The benchmark IPCA inflation index, which was previously expected to reach 4.7% this year, should now get closer to 5.0%, said Inter's chief economist Rafaela Vitoria.
That would place it slightly above the higher end of the central bank's target range of 1.75% to 4.75%.
NO OTHER OPTION
This was the first hike by the oil giant since a new pricing policy was implemented under President Luiz Inacio Lula da Silva, who took office in January pledging to change the firm's strategy in order to help it lower consumer costs at the pump.
Petrobras approved the new policy in May, ditching a more market-based strategy in favor of greater flexibility to smooth price swings, but said it had no option other than raising prices this time.
"The consolidation of oil prices at a higher level makes it necessary for Petrobras to make the price adjustments for both fuels," the company said.
Crude oil prices in international markets have registered gains for the past seven weeks.
CEO Jean Paul Prates had previously said that even though the new policy would avoid passing international volatility onto customers, Petrobras' fuel prices would not dip "below profitability."
Petrobras noted its gasoline prices are still down roughly 5% year to date, while diesel prices have fallen by an accumulated 15.4% in the period.
Santander analysts said the firm's refining margins "should be restored to healthy levels after today's adjustment," adding in a note to clients that they believe no further hikes will be necessary for now.