OTTAWA, April 16 (Reuters) - Canada's annual inflation rate ticked up to 2.9% in March, as expected, while core inflation measures continued easing for a third consecutive month, data showed on Tuesday.

Analysts polled by Reuters had forecast inflation to accelerate to 2.9% from 2.8% in February. Month-over-month, the consumer price index rose 0.6%, the largest increase since July 2023, but less than a forecast of 0.7% gain.

The acceleration in the annual rate was driven by costlier gas at the pump as supply concerns and voluntary production cuts pushed global crude prices higher, Statistics Canada said. Excluding gasoline, inflation slowed to 2.8% from 2.9% in February.

The Bank of Canada (BoC), trying to cool inflation down to a 2% target, kept its key interest rate unchanged at a near 23-year high of 5% last week, but said a cut in June was possible if the recent cooling trend in inflation is sustained.

Headline inflation has now stayed under 3% since January and is still in line with the BoC's forecast for it remain close to 3% in the first half of 2024.

CPI-median and CPI-trim - the bank's preferred measures of underlying inflation - cooled more than expected. CPI-median slowed to 2.8% from 3% in February while CPI-trim decreased to 3.1% from 3.2%. Economists had expected CPI-median to edge down to 3.0% and CPI-trim to remain at 3.2%.

The BoC increased rates by 475 basis points to a 22-year high between March 2022 and July 2023 and has kept them on hold since then for six consecutive meetings in its efforts to cool inflation. The BoC's next rate announcement is on June 5, and the bank will also have data for April before then.

In March, shelter prices continued to apply upward pressure in March, with the mortgage interest cost and rent indexes contributing the most to the year-over-year gain in the all-items CPI, Statscan said.

Services inflation accelerated to 4.5% in March from 4.2% February, driven by air transportation and rent, while goods inflation slowed slightly to 1.1% from 1.2%.

Excluding volatile food and energy, prices rose 2.9% compared with a 2.8% increase in February. (Reporting by Ismail Shakil in Ottawa; Editing by Dale Smith)