The company posted a net profit of €481 million ($$535 million) in the July-September period, compared to a net loss of 221 million euros in the same year-ago period.
The result was higher than forecast by analysts polled by Factset who predicted the company would table a net profit of €308 million.
"The efficiency and savings measures implemented by Repsol throughout the year improved earnings and bolstered the company's resilience to the current environment of depressed crude oil and gas prices," the company said in a statement.
Repsol in October 2015 unveiled an ambitious cost-cutting programme outlined in October 2015 which involves slashing billions from capital spending by 2020 and slashing 1,500 jobs by 2018.
The company said lower spending on exploration helped it to drastically reduce its loss in its upstream operations to €28 million from €395 million in the third quarter of 2015 despite the slump in oil and gas prices.
In its downstream operations, which includes refining, earnings fell 42 percent in the third quarter to 395 million euros from a year earlier due to lower margins, the company said.
During the first nine months of the year Repol's posted a net profit of €1.12 billion, a 35 percent increase over the same time last year.
Oil prices have recovered to around $50 a barrel since producers cartel OPEC agreed at the end of September to cap output in a bid to tackle an oversupply that has hammered prices.
Nevertheless, crude prices are still only about half their mid-2014 levels.