MADRID (Reuters) - The board of Spain's Repsol (>> Repsol SA) unanimously agreed on Wednesday to start formal talks with Argentina over a compensation offer for assets Buenos Aires seized last year that could end an 18-month standoff between the two countries.

Sources with knowledge of the matter have told Reuters that the deal is worth $5 billion, half of what Repsol was initially demanding after Argentina seized its majority stake in energy company YPF (>> YPF SA) in 2012.

"With the aim of developing a preliminary agreement, Repsol has decided to start talks soon between its teams and the Argentine government to find a fair, efficient and quick solution to the controversy," Repsol said in a statement, without providing details of the offer.

It has hired an international investment bank to oversee the process.

Bilateral ties between Spain and Argentina have been on ice since the nationalisation in April 2012, so any deal has significance beyond Repsol's own interests, particularly for Argentina as it seeks to restore investor confidence.

Argentine President Cristina Fernandez is trying to attract the billions of dollars needed to exploit the Vaca Muerta (Dead Cow) shale formation to help bolster central bank reserves drained in part by costly oil and gas imports.

Sources have said the settlement, which has the backing of the Argentine and Spanish governments, was likely to be in the form of U.S. dollar-denominated 10-year sovereign bonds rather than cash.

The YPF expropriation was a blow to Repsol, which has spent much of the past year in recovery mode, launching legal battles against Argentina while trying to compensate for the loss of a division that had accounted for a third of its production.

It rejected a settlement from Argentina in June that included a small stake in Vaca Muerta and has said it would not reinvest in the country. Analysts have said it will probably sell its remaining 12.1 percent stake in YPF after a deal.

SHAREHOLDER TURMOIL

While Repsol's earnings and shares have recovered from the 2012 loss of YPF thanks to strong output from new exploration and production projects, at least one shareholder remains bitter over Chairman Antonio Brufau's handling of the dispute.

The chief of Mexican state oil monopoly Pemex, who has close ties with Argentina and has expressed interest in exploiting Vaca Muerta, lashed out against Brufau's salary and management last week after months of pushing for an agreement over YPF.

Repsol said its entire board voted to support the Spanish oil company's strategy and management team on Wednesday, with the exception of Pemex, which holds 9.4 percent of Repsol.

In a separate statement, Pemex said it voted against Repsol's current management "because it had not offered desirable results for the company and its shareholders" but said it would continue to work in support of the company's best interests.

Repsol's other main shareholders include Catalan lender La Caixa with 12 percent, indebted Spanish builder Sacyr (>> Sacyr SA) with 9.5 percent and Singapore state fund Temasek with 6.3 percent.

Repsol shares closed 0.26 percent higher at 19.29 euros, after gaining 4.3 percent on Tuesday on hopes for a deal.

(Reporting by Tracy Rucinski; Editing by Paul Day and David Evans)

By Tracy Rucinski and Andrés González

Stocks treated in this article : Sacyr SA, Repsol SA, YPF SA