Its net profit of 1.73 billion euros ($1.82 billion) compared with a loss of 1.4 billion euros in 2015.
In the final quarter of 2016, it made a net 616 million euros, overturning a loss of 2.84 billion euros in the same period one year before.
CEO Josu Jon Imaz said Thursday that the company had reduced its operational costs by more than 1.6 billion euros. Repsol also benefited from the acquisition of Canadian oil company Talisman, which increased production and exploration assets.
Shares in Repsol S.A. gained 1.5 percent to 13.9 euros in early Madrid trading.