Russia exited a recession last quarter, the Economy Ministry said, as a gauge tracking the nation’s manufacturing industry unexpectedly rose to a four-year high in October.

Seasonally adjusted growth in gross domestic product reached 0.1 percent in the third quarter from the previous three months, the ministry’s press office said by e-mail on Tuesday. That ends a period of decline that the state development lender Vnesheconombank estimates lasted for eight quarters. A technical recession is commonly defined as at least two consecutive quarters of contraction.

“The economy has turned the corner,” Ravi Bhatia, director for sovereign ratings at S&P Global Ratings, said at a conference in Moscow on Tuesday. “We expect the return to positive real GDP growth in 2017-2019. And this, hopefully, will be the last year of economic contraction.”

The world’s biggest energy exporter is righting itself from the longest slump under President Vladimir Putin. Adding to signs that growth is finally within reach, the Manufacturing Purchasing Managers’ Index rose to the highest since October 2012, exceeding all forecasts in a Bloomberg survey of six economists.

Rising production among manufacturers and domestic orders outweighed a continued decline in new business from abroad. The manufacturing gauge rose to 52.4, a third consecutive month of expansion, from 51.1 in September, according to a statementreleased by Markit Economics on Tuesday.