Pipelines run at the McKay River Suncor oil sands in-situ operations near Fort McMurray, Alberta, September 17, 2014. REUTERS/Todd Korol

OTTAWA (Reuters) - The Canadian economy grew in August for the third straight month after contracting in the first five months of the year, with oil and gas continuing to recover and manufacturing also making a contribution, Statistics Canada said on Friday.

Gross domestic product showed an inflation-adjusted increase of 0.1 percent, as forecast in a Reuters survey of analysts, following more substantial boosts of 0.4 percent and 0.3 percent in June and July, respectively.

The fact that the economy has built on July’s strong gain bodes well for the third quarter as a whole.

“It basically puts us bang on to the Bank of Canada’s 2.5 percent annualized Q3 forecast,” David Tulk, chief Canada macro strategist at Toronto Dominion Bank.

The drops earlier in the year were primarily driven by the energy sector, which was badly set back first in exploration and then in extraction by the oil price crash.

The volume of oil and gas output rose 0.3 percent in August, after gains of 2.6 percent and 3.9 percent in June and July. It sat 6.5 percent higher than a year earlier but was still below February’s peak.

The biggest hit on the energy sector, in inflation-adjusted percentage terms, has been in reduced investment in drilling and exploration. The category of support activities for mining and oil and gas extraction, which largely reflects such investment, was up 2.9 percent from July but was still a whopping 38.1 percent lower than a year earlier.

Although Statistics Canada had reported two weeks ago a 0.2 percent fall in August manufacturing sales, it said manufacturing output had increased 0.4 percent during the month. The discrepancy is accounted for by a rise in inventories.

The Canadian dollar weakened slightly on the data, to C$1.3160 to the dollar, or 75.96 U.S. cents, at 9:30 a.m. ET, from C$1.3152, or 76.03 U.S. cents, just before.