By Raul Gallegos, Bloomberg Argentina’s apparent offer to pay Repsol SA US $5 billion for having seized its majority stake in the Argentine energy company YPF may come close to the best deal the Spanish oil giant will get. By announcing that it “views favourably” Argentina’s “heads of agreement,” Repsol is verging upon finally losing a 19-month battle for compensation. The offer is less than half the $10.5 billion Repsol originally sought for the 51% stake in YPF, which President Cristina Fernandez de Kirchner nationalized last year. Repsol based its estimate on a valuation method that the Argentine government included in the YPF bylaws when it privatized the company in 1993. But Fernandez has refused to honor that. Argentina’s asset grab crippled Repsol. YPF made up about a third of the company’s proved reserves in 2011, according to Moody’s. It provided almost half of Repsol’s 2011 output and an average of more than $1 billion a year in cash dividends over almost a decade. Losing YPF forced Repsol to sell assets to get back on its feet. So, Repsol clearly lost this fight so far. But who has won? 1. Fernandez: Argentina's president can sell a deal to a domestic audience as a political victory. Forcing Repsol to accept less than half what it demanded and reportedly offering to pay the company in 10-year bonds makes the populist leader appear to be a strong negotiator. Coming close to ending the conflict not only helps counter critics who argued that the government stole YPF assets, but also suggests Fernandez is serious about turning around the country's troubled energy business. 2. Carlos Slim: The Mexican billionaire, the world’s second richest man according to the Bloomberg Billionaires Index, controlled an 8.4% stake in YPF as of a mid-June 2012 filing. The price for YPF’s US-listed shares has risen 192% since then and is now worth more than $989 million, according to Bloomberg data. YPF shares rose 13.3 percent from Monday through Wednesday, amid talk of a possible settlement between Repsol and Argentina's government. Slim’s reported investment in YPF’s October bond issue suggests savvy investors buy when assets look scary and cheap. 3. Chevron: Chevron Corp.'s decision to strike a controversial deal with YPF last year gained the company a foothold in Argentina’s famous Vaca Muerta shale formation -- the world’s second-largest shale gas and fourth-largest shale oil accumulation. This may have earned Chevron a Repsol lawsuit, but the deal now looks well timed. Supporting a troubled Argentina also gained the company goodwill among leftist politicians who could remain in power after Fernandez leaves office. 4. Pemex: Mexico’s decision to serve as a mediator between Argentina and Repsol is no disinterested gesture. Its troubled, state-owned oil company Petroleos Mexicanos, or Pemex, would also consider investing in the Vaca Muerta shale formation. Pemex’s 9.4% ownership of Repsol gave the Mexican company an incentive to help end the dispute that has hurt the Spanish company's fortunes. Bloomberg data show Repsol’s shares up 3% since talk of the potential YPF agreement became public. 5. YPF: YPF is the biggest winner from Argentina and Repsol’s decision to bury the hatchet. YPF plans to invest $35 billion over five years to turn business around in the energy-import-dependent country. To do that, YPF needs strong partners such as Chevron and the ability to tap capital markets relatively cheaply. Settling a major nationalization dispute gives the troubled company easier access to both. The hostility between Repsol and Argentina may soon be over, but there's certainly still some ill-will brewing. Repsol's CEO Antonio Brufau has been absent from the deal presumably because his presence is considered counterproductive (he reportedly had a more militant, legal approach to recovering Repsol's money). Repsol is also now left out of a key global oil patch it helped discover, and is held at arms length by YPF, a company in which it still holds a 6% stake. A $5 billion check is not a bad thing, but sometimes getting paid doesn't make you a winner. Raul Gallegos is the Latin American correspondent for the World View blog and a contributor to the Ticker.