Canada's economy stalled in July and edged up slightly in August, data showed on Friday, highlighting a recent sluggish performance that prompted markets to trim bets for another interest rate hike next month.

Growth ground to a halt in July as the manufacturing sector posted its biggest decline in more than two years, but it most likely ticked up 0.1% in August, Statistics Canada said.

Analysts polled by Reuters had forecast a 0.1% monthly gain for July after a 0.2% contraction in June. The economy is slowing after the Bank of Canada's decision to raise rates 10 times since early last year.

"The economic data ... continue to paint a picture of an economy that has stalled," Royce Mendes, head of macro strategy of Desjardins Group said in a note. "(That) should give central bankers confidence that their medicine is slowly working."

The bank held its key overnight interest rate at 5% on Sept. 6, noting the economy had entered a period of weaker growth while warning it could hike again if inflation gets stuck well above its 2% target.

After the release of the gross domestic product figures, money markets trimmed bets for a rate hike next month to a 27%chance from a 31% chance before.

"Canada is really struggling to grow right now ... (this) argues for (the bank) to remain on hold and lean on the tightening that has already been put in place," said Robert Kavcic, senior economist at BMO Economics.

The Canadian dollar was trading 0.4% higher at 1.3434 per U.S. dollar, or 74.44 U.S. cents, as the greenback gave back some recent gains against a basket of major currencies.

The economy unexpectedly contracted in the second quarter at an annualized rate of 0.2%, far lower than the Bank of Canada's forecast of a 1.5% annualized rise.

"The third quarter as a whole is tracking growth of a little under 0.5% annualized, which is a very muted rebound following the second quarter's surprise decline," said Andrew Grantham, senior economist at CIBC Capital Markets.

Overall in July, the service-producing sector edged up 0.1% while the goods-producing sector posted a 0.3% contraction.

The manufacturing sector shrank by 1.5% over June, the biggest month-on-month drop since April 2021, largely due to firms drawing down their inventories.

Some sectors hit by wildfires in June bounced back in July. Mining and quarrying, except for oil and gas, jumped by 4.2% while accommodation and food services posted a 2.3% gain.

(Reporting by David Ljunggren and Steve Scherer; additional reporting by Dale Smith in Ottawa and Fergal Smith in Toronto; editing by Jonathan Oatis)