The Philippines’ gross domestic product grew at its fastest pace in three years last quarter, underscoring the nation’s resilience to global risks as investment surged and consumers spent more. Stocks gained, official data showed on Thursday.

Analysts had expected Philippines GDP to fall to 6.7% last month. Compared with the previous quarter, GDP rose 1.2 percent, in line with economists’ estimates.

In a report, National Statistical Coordination Board said that Philippines GDP rose to a seasonally adjusted annual rate of 7.1%, from 7.0% in the preceding month.