(Adds company quotes)
BUENOS AIRES, May 7 (Reuters) - Argentina's state energy company YPF posted better than expected first-quarter profit on Thursday but earnings were still down 24.3 percent on the year due to the global slide in oil prices.
YPF posted profit of 2.109 billion pesos ($239 million) in the January to March period, beating the consensus forecast in a Reuters poll of economists that was for profit of 1.5 billion pesos. However, this was significantly below the 2.787 billion pesos achieved in the same period last year.
"During this period, the price in international crude halved, a situation that directly impacted the results of the major companies in the sector," YPF said in a statement.
Oil output at YPF, which was nationalized in 2012, rose 2.3 percent in the quarter, while natural gas production climbed 18 percent, the company said in its earnings statement.
Shale oil and gas output from 332 wells in the vast but barely tapped Vaca Muerta formation was 41,700 barrels per day equivalent, YPF said.
Argentina nationalized YPF in 2012 after accusing its former parent, Spain's Repsol SA, of under-investing and thereby generating a costly energy deficit for Latin America's No. 3 economy.
The country hopes that by hiking investments in Vaca Muerta, viewed as one of the biggest shale reserves in the Western Hemisphere, it will be able to reduce energy imports that are draining its low foreign reserves.
YPF raised $1.5 billion in a bond sale last month.
"Investments in the first quarter of 2015 reached 12.351 billion pesos, a level that has enabled us to maintain activity and growth in production in a global context that is unfavorable for this industry," YPF said.
$1=8.8225 Argentine pesos at the end of March Reporting by Sarah Marsh and Eliana Raszewski; Editing by Peter Galloway, Andrew Hay and Bernard Orr