Repsol SA has sold nearly all is stake in YPF SA in Argentina, marking its final break with that company just two years after the Argentine government seized over 51% of the leading producer of oil in the country.

Repsol sold off 12% via Morgan Stanley of YPF for just over $1.26 billion, which was a gain pretax of $622 million, said the company based in Madrid through a prepared statement.

Repsol is the largest oil business in Spain. It is scheduled to report earnings for the first quarter this week and new retains a stake that is less than 0.5% following the sale.

Cristina Fernandez de Kirchner the President of Argentina ordered YPF’s nationalization in April of 2012 alleging that Repsol the parent company failed to invest sufficiently in maintaining the production of oil.

The Spanish oil producer, which said the seizure had been illegal, and Argentina agreed on a compensation package earlier in 2014 of $5 billion.

Armed with cash from the compensation package and proceeds of the deal today, Repsol is planning to spend up to $10 billion to acquire gas and oil production assets, mainly in countries that are developed, said Antonio Brufau the Executive Chairman.

Repsol stock is up 7.3% the past year and was up just 0.4% to 19.40 euros in early Wednesday trading in Madrid.

Repsol last week appointed to CEO Josu Jon Imaz San Miguel. Brufau gave up that position while maintaining the Chairman of the Board. Imaz has been the refinery division head and will pursue more growth via acquisitions, said Repsol when his appointment was announced.

Argentina said it would issue up to $6 billion sovereign bonds for the compensation payments. The company based in Spain said its intentions are to monetize the securities within the next few years.

Argentina has followed other South American governments, such as Venezuela, in repatriating some of the industries in their countries.