MADRID (Reuters) - Spanish oil major Repsol's (>> Repsol SA) board is set to accept compensation of $5 billion in bonds for Argentina's nationalization of its stake in YPF (>> YPF SA), less than half it had demanded, sources close to the board said.

The 2012 seizure of Repsol's 51 percent of the Argentine unit not only infuriated the company and the Spanish government, but also created tensions between Spain and Mexico, a core shareholder in Repsol through its state oil monopoly Pemex, over the handling of the dispute.

The fact that the proposal was thrashed out at a meeting in Buenos Aires with representatives from the Spanish, Argentine and Mexican governments as well as top Repsol executives and board members indicates broad support for a deal that will end 18 months of rancour and legal wrangling.

"The initial agreement already has the backing of Repsol's management, its main shareholders and the governments, meaning that with all probability the board will give the green light," one of the sources said.

Another source, close to another key board member, said the main thrust of the deal was positive for Repsol, which had been seeking $10.5 billion, and it was highly unlikely to be rejected at the meeting on Wednesday.

Repsol's shares climbed 4.25 percent to 19.24 euros per share, a top gainer on a flat blue chip Spanish index <.IBEX>, as investors cheered the potential end to a year-long conflict that had battered the oil major's shares.

Key corporate shareholders of Repsol, including some who were critical of Repsol CEO and Chairman Antonio Brufau's handling of the conflict with Argentina, were also involved in talks in Buenos Aires to strike a deal that could benefit their own business.

Among them was Isidro Faine, the chairman of La Caixa bank (>> CaixaBank SA), which has 12 percent of Repsol and also owns stakes in large Spanish companies like Telefonica (>> Telefonica SA) and Gas Natural (>> Gas Natural SDG SA), both with interests in Argentina and Mexico.

Joining him was Emilio Lozoya, the chief executive of Mexican oil company Pemex, who has a 9.4 percent stake in Repsol and is keen to explore Argentina's vast shale oil and gas deposits. The Vaca Muerta deposits, believed to be among the largest in the world, could now receive a wave of international investment.

Repsol's second largest shareholder, indebted Spanish builder Sacyr (>> Sacyr SA), also stands to gain from a deal that would likely bring the value of Repsol shares above 19.9 euros each, the amount at which Sacyr carries them in its books.

Sacyr's shares were 5.37 percent higher at 3.85 euros each in early Tuesday trading.

(Editing by Julien Toyer and Will Waterman)

By Carlos Ruano and Tracy Rucinski