MADRID (AP) — Spanish energy company Repsol says cost reduction efforts, resumed production in Libya and rising market prices for crude boosted its earnings rise last year.

Repsol S.A. said Wednesday it posted net income of 2.121 billion euros ($2.6 billion) in 2017 — a 22 percent increase on the previous year and the highest in the last six years.

Its upstream operations, including exploration and production for oil and gas, posted a profit of 632 million euros, 12 times higher than in 2016. Profits from refining and retail operations came in at 1.88 billion euros, in line with previous years.

Production rose to 695,000 barrels a day, the highest in the last six years.

In early trading Wednesday on the Madrid stock exchange, Repsol shares were 0.77 percent higher at 14.32 euros.