MADRID (Reuters) - The board of Spain's Repsol (>> Repsol SA) was set to gather late on Wednesday to accept what sources said was a preliminary $5 billion compensation offer from Argentina over assets seized last year, in a deal that could end 18 months of uncertainty.

The meeting at Repsol's headquarters in central Madrid is expected to approve a deal that is half of what Repsol was initially demanding after Argentina seized its majority stake in energy company YPF (>> YPF SA), sources close to the board told Reuters on Tuesday.

Bilateral ties between Spain and Argentina have been on ice since the nationalisation in April 2012, so the deal has significance beyond Repsol's own interests.

Yet the affair may continue to raise questions about Chairman Antonio Brufau's future at Repsol, where he has been chief since 2004.

Brufau's relationship with Argentine officials is strained so he worked on the deal from Madrid, rather than travelling to Buenos Aires to take part in the discussions.

Details of the settlement, which has the backing of the Spanish and Argentine governments, have not yet been revealed, but sources with knowledge of the matter say Argentina is offering 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.

The nationalisation also stoked tensions among some of Repsol's core shareholders, who have criticized Brufau's handling of the dispute.

Emilio Lozoya, CEO of Mexican state oil monopoly Pemex with 9.3 percent of Repsol, lashed out against Brufau's salary and management last week after months of pushing for an agreement with YPF.

Lozoya was part of the delegation that met in Buenos Aires on Monday to thrash out the compensation deal, along with Spanish and Argentine government officials and top Repsol executives.

Also joining the meeting was Isidro Faine, head of Repsol's leading shareholder, lender La Caixa, which also owns stakes in other large Spanish companies such as Telefonica (>> Telefonica SA) and Gas Natural (>> Gas Natural SDG SA) which have interests in Argentina.

Repsol shares were flat at 19.23 euros by 1455 GMT, after gaining 4.3 percent on Tuesday on hopes for a deal.

(Editing by Fiona Ortiz and David Holmes)

By Tracy Rucinski

Stocks treated in this article : Telefonica SA, Gas Natural SDG SA, Repsol SA, CaixaBank SA, YPF SA