Image caption The Greek government is continuing with austerity measures despite protests

Ratings agency Standard and Poor's has raised the credit rating of Greece's sovereign debt by six levels, praising the "strong determination" of fellow eurozone countries to help it stay as a member state.

S&P has increased Greece's rating from "selective default" to "B-minus".

The agency also praised the continuing efforts by Greece's government to cut its spending.

Greece is currently receiving the second of two bailouts.

Last week, Greece started to receive the latest tranche of the bailout funds from the European Union and International Monetary Fund.

They agreed to release 49.1bn euros ($57bn; £37bn) after continuing austerity work by Greece, and a buyback of some of its debt.

A total of 240bn euros has been earmarked for Greece from the two bailout loans.

So far, Greece has received nearly 149bn euros (£119bn; $191bn) from the eurozone and the International Monetary Fund, out of that 240bn euros.

This is a significant upgrade, which the Greek government will consider a vote of confidence, but it seems to be more of a vote of confidence in the euro in general.

S&P said in its statement: "The upgrade reflects our view of the strong determination of European Economic and Monetary Union (eurozone) member states to preserve Greek membership in the eurozone.

"The outlook on the long-term rating is stable, balancing our view of the government's commitment to a fiscal and structural adjustment against the economic and political challenges of doing so."

Greece had to seek the bailouts to meet its debt repayments after years of overspending meant it could not keep up with its debt obligations.

The negative market opinion of Greece's situation only worsened its position, as it pushed up the yield, or level of interest, that the the country had to offer on the sale of its new government bonds, in order to attract buyers.

The BBC's economics editor Stephanie Flanders said of S&P's announcement: "This is a significant upgrade, which the Greek government will consider a vote of confidence, but it seems to be more of a vote of confidence in the euro in general.

"Greece is not out of the woods economically, by any stretch of the imagination. But financial markets do now think a Greek exit from the euro is less likely.

"S&P is catching up with that market optimism with this upgrade. In theory, the fact that a large part of Greek sovereign debt has already been restructured also makes future defaults a bit less likely."