Standard & Poor's ratings agency Tuesday upgraded Greece's credit grade by 6 notches, yanking the debt-heavy country out of default but still keeping its devalued bonds in junk status.

The agency said the upgrade to B- -- the highest grade it has given Greece since June 2011 -- reflected its view that the other 16 European Union countries using the euro are determined to keep Greece inside the currency union. It also gave Greece a stable outlook, meaning it is less likely to change its rating again soon.

"The stable outlook balances our view of eurozone member states' determination to support Greece's eurozone membership," the agency said in a statement.

Greece's finance minister welcomed the upgrade, but pledged to forge on with promised reforms and savings measures.

"It's a decision that creates a mood of optimism, but we are well aware that we still face a long uphill course ahead," Yannis Stournaras said. "We are not relaxing in our efforts."

advertisement | advertise on newsday

An upgrade was expected since S&P had earlier this month temporarily lowered Greece's rating to the bottom of its scale -- ''selective default'' -- because the country was buying back its own debt. The agency said that because the buyback did not force any investors to sell their bonds back -- which would have constituted a default -- it was raising the rating back up.

The bond buyback was successfully completed last week and will reduce the country's debt by some $26.4 billion.

The size of the upgrade suggests EU leaders are seeing some results in their effort to bring Greece's debt load back under control.

However, the credit rating is increasingly losing any market relevance because there are very few private-sector investors still holding Greek bonds. After completing the buyback and receiving multiple bailout packages over three years, Greece now owes the bulk of its debt to fellow eurozone states, the IMF and the European Central Bank.

Greece's government bonds have been rated as noninvestment grade -- or junk -- since 2010, when the country's finances imploded after Athens admitted it had severely underestimated its budget deficit.