* $5 bln comes after $4.4 bln for Pemex in 2020 budget
* Pemex to prepay bonds that mature in 2020 and 2023
* Pemex also plans to refinance short-term debt (Adds S&P statement, analyst comment)
By Miguel Gutierrez and Daina Beth Solomon
MEXICO CITY, Sept 11 (Reuters) - Ratings agencies gave a cautiously positive assessment on Wednesday of Mexico's $5 billion cash injection into state oil company Pemex, but it did not dispel the risk of another downgrade of its bonds to speculative grade, or junk, in the next few months.
The step was the latest by President Andres Manuel Lopez Obrador to plot a brighter future for the cash-strapped oil and gas producer with ballooning debt and years of declining output.
In June, Fitch became the first agency to downgrade Pemex debt to junk. Another downgrade by Moody's would force some investors to sell billions of dollars of Pemex bonds.
The $5 billion aid package appeared to be in addition to a $4.4 billion contribution, including cash and tax relief, unveiled in the government's 2020 budget plan last weekend.
Saddled with more than $104 billion of financial debt, Pemex said it plans to use the capital for the prepayment of bonds that mature in 2020 and 2023. It also will issue new bonds in maturities of seven, 10 and 30 years to refinance short-term debt. It did not give a value for the new bond placements.
"Proceeds from this transaction will be used to ensure a reduction in the outstanding balance of Pemex's debt," the company said in a statement.
S&P Global Ratings, one of the three major credit agencies, described the cash injection positively, saying it underscored the "overarching and unconditional federal support" for Pemex.
In a statement, the agency rated Pemex's new bonds at BBB+, or three notches within S&P's investment grade rankings.
Pemex bonds were the most traded by volume among emerging market corporates following the morning announcement, according to MarketAxess. The news sent both the 6.5% Jan. 2029 and the 6.5% Mar. 2027 over 2 points.
Fitch Ratings said it would rate the new debt one notch into "junk" status, in line with its existing Pemex debt rating.
Although it noted that a successful transaction would improve Pemex's liquidity, Fitch said it viewed government support as "moderate" given Pemex's heavy tax burden.
"The company continues to severely underinvest in its upstream business," Fitch said, referring to finding and extracting oil and gas deposits. That underinvestment "could lead to further production and reserves decline," it added.
Moody's, meanwhile, also took a cautious view, pegging the new debt's rating to Pemex's existing level, just above junk, and saying the company had underlying challenges.
"Pemex's intrinsic liquidity is still weak and the company remains reliant on government support until it can consistently generate free cash flow," the agency said.
"The amount of planned capital spending will still fall well short of replacing reserves in 2019 and 2020."
Other analysts said the latest government support for Pemex may only buy time until a more comprehensive reform of its tax obligations is enacted.
Otherwise, additional government cash injections will ultimately harm the government's own creditworthiness.
"Any recurring support (the government) can provide, absent a fiscal reform, will cost the sovereign a deterioration in the fiscal deficit, which causes a sovereign downgrade, which will eventually lead to a Pemex downgrade," said Shamaila Khan, head of emerging market debt at New York-based AllianceBernstein.
"There is no way around a Pemex downgrade except to do a fiscal reform and they still don't seem to be in favor of doing that," added Khan.
Pemex Chief Financial Officer Alberto Velazquez told Reuters in June the company planned to refinance $2.5 billion this year.
The finance ministry said the fresh capital will have no effect on net public sector debt or on public sector borrowing requirements, the broadest measure of public sector debt.
Meanwhile, Finance Minister Arturo Herrera has vowed to defend Pemex's credit rating, saying the firm has money to invest and to manage its debt profile so it is "more adequate." (Reporting by Daina Beth Solomon in Mexico City, Additional reporting by Rodrigo Campos in New York, and Stefanie Eschenbacher and David Alire Garcia in Mexico City; Editing by David Gregorio, Marguerita Choy and Tom Brown)