The deal seeks to repair the financial hit taken by Repsol when Argentina's President Cristina Kirchner ordered the nationalisation of Repsol's 51-percent stake in YPF in April 2012.
"We have worked very hard to obtain a just compensation. Our efforts have been rewarded with a guaranteed agreement that creates value for our shareholders and strengthens the company's financial position," Repsol president Antonio Brufau said after shareholders approved the deal at an annual general meeting.
"Today we embark on a new phase, full of hope and growth prospects for Repsol," he added in a statement.
The compensation is to be paid in Argentine government bonds. The deal still must be approved by Argentina's parliament.
The expropriation soured relations between Argentina and Spain and sparked international outrage including from Spain's European Union partners.
Kirchner blamed it on Repsol's failure to make agreed investments in the firm. Spain saw it as a blow to its strategic interests.
The nationalisation of its subsidiary in Argentina hit Repsol's profits hard in 2013, falling by 90 percent over the previous year to €195 million.
Repsol said the expropriation of YPF forced it to make provisions of €1.28 billion in 2013, hitting its financial results.
Settlement of the dispute could help to lure investment to the vast Vaca Muerta shale oil and gas field in Argentina, discovered by YPF in 2010.
It is estimated to contain the equivalent of 22.8 billion barrels of oil, described by Repsol at the time as the largest discovery in its history.