OTTAWA, July 16 (Reuters) - Canada's annual inflation rate cooled a tick more than expected to 2.7% in June, largely due to softer growth in gas prices, while core inflation measures were marginally down, data showed on Tuesday, ahead of the central bank's interest rate announcement next week.

Analysts polled by Reuters had forecast the inflation rate would tick down to 2.8% from 2.9% in May.

Month-over-month, the consumer price index was down 0.1%, compared with a forecast for no change. This was the first deceleration in the monthly inflation rate since December, Statistics Canada data showed.

Tuesday's data showed that headline inflation was cooler than the Bank of Canada's 2.9% inflation forecast for the end of the first half of 2024. The central bank, in forecasts released in April, said inflation is expected to gradually slow down to under 2.5% in the second half of 2024 before reaching the bank's 2% target in 2025.

The BoC will publish updated forecasts on July 24, along with its rate decision. Last month, the bank trimmed its key overnight rate by 25 basis points after holding it at a more than two-decade high for about a year, and money markets see a roughly 80% chance of another cut next week.

The average of two of the Bank of Canada's preferred measures of underlying inflation - CPI-median and CPI-trim - eased slightly to 2.75% in June from 2.80% in May.

The deceleration in headline inflation was largely attributable to slowdown in gasoline prices, which rose at an annual rate of 0.4% in June, down from 5.6% in May. Excluding gas prices, the CPI rose 2.8% on an annual basis, Statscan said.

Increase in prices for food purchased from stores as well as a smaller decline for cellular services in June kept the cooling in inflation in check.

Excluding food and energy, prices rose 2.9% in June, same as May.

Service prices increased 4.8% annually in June, compared with a 4.6%% rise in May, while goods inflation slowed to 0.3% from 1%.

(Reporting by Ismail Shakil in Ottawa; Editing by Promit Mukherjee)