Canada's economy expanded by 0.3 per cent in July, down from June's 0.4 per cent growth but ahead of what economists had been expecting.

Statistics Canada reported Wednesday that the expansion was broad based, with the mining, quarrying, and oil and gas extraction, manufacturing, and finance and insurance sectors all showing growth.

Economists had been expecting growth to come in at around 0.2 per cent.

Canada's economy has now expanded for two months in a row in June and July after contracting for the first five months of the year.

The data agency's previous gross domestic product release, for June, was one of the most closely watched in recent memory, as economists wondered if the second quarter as a whole would show a contraction in the economy, just as the first one did.

Some economists consider two consecutive quarters of contraction to be the bare minimum to call determine a recession. That bar was met because the declines in April and May were too large to be offset by growth in June. But monthly growth in June prompted hopes that the economy may have turned the corner, and a second straight expansion in July — even a tiny one — suggests that may be the case.

June GDP revised downward

Statistics Canada often revises its previous numbers higher or lower in retrospect, as new data for the time period comes in. The data agency did just that on Wednesday, ratcheting June's figure down from an originally reported 0.5 per cent down to 0.4.

By that metric, the recession that Canada's economy entered into during the first half of 2015, was marginally worse than originally thought. But two consecutive months of GDP growth suggests that whatever one wants to call that economic slowdown, on a macroeconomic level at least, it's over.

Scotiabank noted in a commentary after the numbers were released Wednesday that while it's still early, the third quarter is currently tracking at 2.3 per cent annualized growth compared to the second quarter — well ahead of the Bank of Canada's forecast of 1.5 per cent, and further evidence the economy might be improving.

"[The] positive print for July GDP... further reinforces our understanding that the economy is turning higher into the third quarter," the bank said.

Benjamin Reitzes at Bank of Montreal agreed, saying "the back-to-back gains in GDP suggest that the economy rebounded firmly from the very weak first half of 2015."

TD Bank economist Diana Petramala cautioned that while the third quarter was looking stronger than expected, questions remain about whether the pace will be sustained in the last three months of the year.

Petramala noted the Pan Am Games in Toronto and the FIFA Women's World Cup likely boosted the economy in June and July.