Mexico's Pemex has reached an agreement in principle with Spain's Repsol and Argentina over compensation for last year's expropriation of 51 pct of oil firm YPF, the Mexican state-run oil company said on Monday.

Pemex said the agreement will fix the amount of compensation due, and the parties will drop legal action over the 2012 expropriation.

Defusing the spat could open the door for Pemex to develop in part Argentina's vast Vaca Muerta field, which has been at the center of the dispute.

(Reporting by David Alire Garcia; Editing by Simon Gardner)