Moody's, which announced the decision on Friday, highlighted "the government's favourable debt trend, driven by fiscal consolidation and robust economic growth", which the agency expects to be sustained.
It moreover pointed to progress with respect to some "important structural reforms, namely with regard to the banking sector, judiciary, and the administrative apparatus of the state".
The agency speaks of efforts to strengthen the banking sector, which are boosting the sector's ability to support economic activity.
The reforms of the judiciary and public administration are also important and have made positive contributions to the country's competitiveness as well as its institutional strength. Slovenia has had a significant problem with backlogs of court cases, which is gradually being resolved, Moody's wrote.
The stable outlook on the ratings reflects Slovenia's largely balanced risk profile at the Baa1 rating level, it said.
"On the one hand, we expect that favourable growth dynamics over the coming years will allow the nominal fiscal balance to continue improving, with positive knock-on effects for the debt burden."
"On the other hand, we recognise that progress on some other areas of structural reform-namely, pension and healthcare reform-are likely to be halting and that the country's structural fiscal balance is expected to deteriorate in the coming years."
Moody's is forecasting 3.6% GDP growth for Slovenia for this year. "Growth has been fairly broad-based in spite of the fact that EU-financed public investment has been slow."
Private consumption has recovered against the backdrop of improved labour market conditions and improved sentiment. Private investment in the export-oriented segments of the corporate sector has been weak in the past but has started to pick up momentum due to capacity constraints and strong profitability.
"Net exports are not likely to play the same positive role that they did a few years ago due to the increase in import spending, but Slovenia is still expected to maintain a very healthy current account surplus that exceeds 5% of GDP."
Moody's expects Slovenia's debt burden, which peaked at 82.6% of GDP in 2015, to fall below 75% next year.
For a further rating improvement, the agency would like to see structural and institutional reforms continue.
A downgrade would meanwhile be caused by a relapse of problems in the banking sector, but "the degree of recapitalisation and restructuring that we have seen thus far implies that even an extreme event of this nature would not have the same negative impact that we observed during the most recent financial crisis".
Finance Minister Mateja Vraničar Erman described the upgrade as an additional confirmation that Slovenia is on the right path. While she expected an upgrade, she did not think it would be that substantial.
"This however in no way means that we are already at the end of the path. Such confirmations need to give us a new momentum and the will to pursue the goals set," the minister commented.
The upgrade by Moody's comes after Standard & Poor's upgraded in June this year the government bond rating for Slovenia to A+ with a stable outlook. Fitch upgraded it to A- with a stable outlook in September last year.