Through his office window, the head of Brazil’s state-run oil company looked out at the cluttered landscape of Rio de Janeiro. Looking back at him, across the city’s run-down high-rises, was the looming statue of Christ the Redeemer. Hawks circled an overflowing trash heap. Plumes of smoke rose from a blaze in a hillside shantytown.

His company, Petrobras, is planning such a rapid increase in oil production that it could become the world’s third-largest producer by 2030, a transformation he believes could play a role in lessening the poverty dotting his vista. This, even as his country positions itself as a leader in the fight against climate change which, of course, is primarily driven by the burning of oil and other fossil fuels.

Petrobras already pumps about as much crude oil per year as ExxonMobil, according to Rystad Energy, a market research firm. Over the next few years, it is projected to hurtle past the national oil companies of China, Russia and Kuwait, leaving only Saudi Arabia’s and Iran’s pumping more than Petrobras by 2030.

It’s an enormous predicament for Brazil’s president, Luiz Inácio Lula da Silva, better known simply as Lula, who has fashioned himself as the pre-eminent world leader on climate issues. By all accounts, Mr. Lula has come around in recent years to believing climate change is a major driver of poverty and inequality, which he has spent his decades-long political career vowing to eradicate.

Since being elected in 2022, Mr. Lula has drastically reduced deforestation in the Amazon and overseen a sizable build-out of renewable energy. But he will also preside over Petrobras’ oil boom and a period of growing gas imports, both of which will facilitate Brazil growing hunger for cheap flights, meatier diets and air-conditioned homes.

However contradictory that might seem, it’s only fair, said Jean Paul Prates, the Petrobras chief executive, perched up high in his company’s gleaming headquarters.