U.S. retail sales unexpectedly rose in January, ending a two-month slump, a new government report showed Monday.

Retail sales climbed 0.2% from December's levels, the Census Bureau said. Economists had projected the figure to be flat with December's levels, according to  data provider FactSet.

Excluding autos, retail sales increased 0.9%, ahead of economists' projections for a 0.2% increase. 

December's 2.1% decline in retail sales excluding autos was the third-biggest on record, according to Deutsche Bank, and it took markets by surprise as a potential sign that the economy might be slowing faster than previously expected.

"The robust core January numbers make sense, given that we didn't believe the terrible-looking December numbers," Ian Shepherdson, chief economist at the forecasting firm Pantheon Macroeconomics, wrote in a note to clients.

Even so, annualized sales growth has slowed from the 4%-plus pace notched in the first part of 2018 following the passage of President Donald Trump's late-2017 tax cuts, and Shepherdson said the latest figure should confirm suspicions that consumption is softening.

U.S. output has been growing for the second longest in U.S. history, at nearly a decade, and three-fourths of economists now expect a recession by 2021. Even so, Trump's top economic advisers have insisted recently that U.S. will grow at a 3% clip in 2019, matching last year's fiscal-stimulus-fueled rate.  

The January rebound in retail sales was driven by a 3.3% gain vs. the prior month in building-materials sales and a 4.8% increase in sporting goods, hobbies, musical instruments and book stores, according to the Census Bureau's press release.

Furniture and home furnishing store sales dropped by 1.2%, while electronics slipped by 0.3%.