AUGUSTA, Maine — The national credit rating company Standard & Poor’s has reaffirmed the state’s AA rating and elevated its outlook for Maine’s financial and economic health from negative to stable, according to the state treasurer’s office Friday.

That was counter to a move by Moody’s Investors Service, a second rating firm currently used by Maine state government to assess its credit, which last week affirmed the state’s Aa2 rating, but revised its outlook from stable to negative.

“I’m pleased that both S&P and Moody’s, the two most prominent rating agencies, affirmed Maine’s solid AA/Aa2 credit. These ratings will continue to give investors confidence in the quality and security of our general obligation bonds, backed by the full faith and credit of the state. Our office anticipates strong demand for our bonds at the May 31 sale,” state Treasurer Bruce Poliquin said in a press release.

On May 31, the treasurer plans to sell approximately $55 million in general obligation bonds approved in past years by the Legislature and voters. Maine has approximately $490 million in outstanding general obligation debt, according to the treasurer’s office.

The state typically borrows money by selling bonds to investors in order to fund capital projects such as road and bridge construction and repair. Credit updates from the national rating agencies are sought to assist with those bond sales, according to the press release.

“We revised the outlook based on our view of Maine’s significant progress in reducing its accumulated unreserved General Fund deficit and unfunded pension liability in fiscal 2011,” said Ken Rogers of Standard & Poor’s in the release. S&P also cited strong fiscal policies and practices, moderate general obligation debt level and improving state economy as reasons for the favorable rating. The credit rating agency also noted the state’s efforts to control spending on MaineCare, which is Maine’s Medicaid program.

Last week, Moody’s said its negative outlook reflects Maine’s “recurring challenges” on the spending side of its budget, “primarily in the Department of Health and Human Services which includes Medicaid.” The agency also saw problems with minimal budget stabilization fund balances — commonly known as a rainy day fund — and a “weak general fund liquidity position reflecting the lack of reserves.”

Moody’s noted in its statement that Maine’s employment growth was for all intents and purposes flat in 2011, compared to a national growth rate of 1.1 percent. The agency also pointed to problems with Maine’s demographics, as well as potential issues with how cuts to state spending may affect specific parts of the economy.

Poliquin said Maine eliminated $1.7 billion in unfunded public pension liability last year. “This action creates a more affordable pension plan for the state, and provides more retirement funding security for the thousands of school teachers and state employees depending on those checks,” he stated.