Rising stock markets helped drive an increase in the market value of workplace pension funds in the third quarter (Q3) of 2016, Statistics Canada reports.

The market value of employer-sponsored pension funds rose by 3.9% in Q3 to $1.7 trillion, StatsCan reports. Equities markets powered the gains, as the value of pension funds’ stocks grew by 5.3% in the quarter, outpacing the S&P/TSX composite index, which grew by 4.3%.

However, other major asset classes also saw gains in the quarter. StatsCan says that the value of pension funds’ bond holdings increased by 4.1%, and their investments in mortgages grew by 4.6%.

Despite the market gains, pension fund net income declined during Q3, as both revenue and expenditures dropped. StatsCan says that pension fund revenue was down by 12.3% in Q3, contributions fell by 7.3% and investment income decreased by 23.4%.

At the same time, expenditures fell by 11%, which helped offset the drop in revenue. Overall, however, net income fell to $25.4 billion in Q3 from $29.2 billion in the second quarter, it says.