NEW YORK, March 1 (Reuters) - S&P Global Ratings upgraded Argentine state energy giant YPF's credit rating to "CCC+" from "Selective Default" following its completion of a debt exchange, the ratings agency said on Monday.

S&P raised its issuer credit ratings on YPF to "CCC+" from "SD" and assigned a stable outlook "reflecting more balanced cash flow and normalizing business conditions."

The rating is limited by Argentina's score, though the stand-alone rating of YPF was raised to "b-," S&P said.

The company, which leads development of the huge Vaca Muerta shale formation in the South American nation, extended debt maturities and lowered interest and principal payments through 2023.

The rating, deep into speculative territoy, however, reflects the uphill road YPF faces to get its finances in order.

"We think it will take YPF at least three years to return to pre-pandemic oil and gas production levels," S&P said, adding that even with the recent rise in prices for oil and natural gas, YPF will struggle to generate free cash flow.

"The company's capex guidance for 2021 is about $2.7 billion, and we expect it to stay between $2.3 billion and $2.5 billion afterward," said S&P.

"However, we believe those levels are ambitious and could be sustained only if oil and gas prices are significantly higher than what we currently assume, with record export levels and/or asset sales." (Reporting by Rodrigo Campos; editing by Jonathan Oatis)