The New York-based agency said Thursday Canada's economic performance and the financial position of its federal government have held up well enough to maintain the company's top rating.

"Although the recession caused a reversal of the improvement in the debt ratios, they did not deteriorate as much as in most other Aaa-rated countries, are now on an improving trend, and remain compatible with the country's Aaa rating," the Moody's report said.

Prior to the recession, Canada's federal government had been running budget surpluses for several years.

That ended after the Harper government spent heavily on infrastructure projects and other initiatives designed to boost the economy following the 2008-09 global credit crisis and recession.

Ottawa remains in the red, although Finance Minister Jim Flaherty has been reducing the size of the deficit each year.

Agencies such as Moody's, Standard and Poor's and Toronto-based DBRS assess the financial stability or risk of governments and corporations around the world and assign them ratings that are used by investors.

The ratings are one of the factors used to determine bond prices and interest rates, as well as whether the bonds are appropriate for conservative funds such as pension plans.

Triple-A ratings can also be used as a point of pride by politicians.

The United States lost its triple-A rating from Standard & Poor's last year, causing a huge political outcry, but Moody's continued to give it top billing.

S&P also lowered France's triple-A rating to double-A-Plus in January but recently affirmed Germany's triple-A rating.

Canada is one of the few jurisdictions that has an undisputed triple-A rating.