(Removes extraneous letters from headline)
* Adjusted Q2 net profit 390 mln eur versus 296 mln forecast
* Refining margins up 19.2 percent, output down 5.8 pct
* Shares up 1.8 percent, in line with market
By Tracy Rucinski and Jose Elías Rodríguez
MADRID, July 24 Cash-rich Spanish oil company Repsol beat quarterly profit forecasts as a jump in its refining margin helped cushion production declines and said it would return money to shareholders if it failed to find suitable acquisitions.
Repsol, the first oil major to publish second-quarter results, on Thursday reported a 19.2 percent rise in its refining margin from a year ago as prices for heavier-grade crudes fell.
The annual increase to $3.10 per barrel appeared at odds with shrinking margins throughout Europe, where an economic slowdown has hit oil demand in the past few years, leaving European refineries operating at overcapacity.
However the margin, an important industry measure of profitability, was down 20 percent from the first three months of the year.
"We view the causes of today's (profit) beat as relatively low quality," JP Morgan Cazenove analysts said in a note to clients.
Repsol's recurring net profit adjusted for one-time gains and inventory effects fell 2.7 percent to 390 million euros ($524 million) from the same period a year ago, but was well above an average Reuters poll forecast of 296 million euros.
"U.S. refineries are using more light crude and this has helped the spread for heavier crudes used by Repsol. But overall the profit beat is the sum of a series of small surprises across different divisions," said Intermoney analyst Alvaro Navarro.
Repsol's shares were broadly in line with gains on Spain's blue chip index, rising 1.8 percent to 18.745 euros.
Repsol is cash-rich after completing its exit from Argentina in May and said on Wednesday that a deal with Canada's Talisman Energy Inc had been among the options it was considering to increase exposure to Organisation for Economic Co-operation and Development countries.
On Thursday the company left the door open to returning cash to shareholders.
"If we don't find the right company or assets we'll have to return cash to shareholders," Chief Financial Officer Miguel Martinez said.
In June, Repsol paid a 1 euro per share special dividend with part of the proceeds from its Argentine exit.
Repsol had 11.2 billion euros of liquidity at June 30 and said net debt had fallen 55.4 percent to 2.39 billion euros from a year earlier.
The unexpected strength from Repsol's downstream business, which also included growth at its chemicals arm, was a reverse in the company's earnings trend, which in recent years had been supported by growth at its exploration and production division.
Oil demand in Spain, Repsol's largest market for its refining and marketing division, was stable in the second quarter from a year ago, indicating the worst of the country's economic crisis may be over.
Spain's unemployment rate fell to its lowest level in two years in the second quarter, data showed on Thursday, lifted by strong job creation in the services sector and adding to hopes of a sustained economic turnaround.
Repsol's total production fell 5.8 percent to 338,000 BOE (barrels of oil equivalent) a day, with new output from countries like Brazil, Bolivia and the United States failing to offset a shutdown in Libya, where oilfields and ports have been seized by rebels since the fall of Muammar Gaddafi in 2011.
Production in Libya resumed in July, Repsol said. ($1 = 0.7437 Euros) (Additional reporting by Ron Bousso in London; Editing by Erica Billingham and Jon Boyle)