By Matt Moffett 

MADRID--Spain's Repsol SA said Thursday its net profit fell 44% in the second quarter, as strong refining results couldn't offset the effect of falling crude prices and the one-time gains that boosted its bottom line in the same quarter a year ago.

The oil and gas company reported a net profit of EUR292 million ($322.6 million) for the second quarter, compared with EUR520 million a year earlier. Last year's second-quarter earnings were supported by the sale of stock in Repsol's former Argentine unit, which had been expropriated by Argentina's government.

Adjusted net profit, which strips out the effect of changes in the accounting value of oil inventories as well as other extraordinary charges and gains, declined 20% in the second quarter to EUR312 million from EUR390 million a year earlier.

Weak oil prices hammered Repsol's oil pumping and drilling division. The unit reported a loss of EUR48 million compared with profit of EUR145 million in the second quarter of 2014.

The weakness in the upstream sector was offset by the strength of the unit that includes Repsol's refining and chemicals operations, which saw second-quarter profit soar 171% to EUR439 million compared with the same period in 2014. The refining sector benefited from improvements in margins and higher utilization rates, Repsol said.

Figures from Talisman Energy Inc., a Calagary-based company acquired by Repsol for $8.3 billion, were incorporated in Repsol's results as of May 8, the company said.

Write to Matt Moffett at matthew.moffett@wsj.com

Subscribe to WSJ: http://online.wsj.com?mod=djnwires