The rate matched the forecast by analysts in a Reuters poll. June marked the third month in a row that the rate has met or exceeded the Bank of Canada's 2.0pc target for inflation.
The Bank of Canada has held interest rates steady since October 2018 as it watches how the domestic economy recovers from a recent slowdown.
The bank is not expected to move again for the rest of the year
The central bank last week projected the overall inflation rate would dip to around 1.6pc in the third quarter because of the dynamics of gasoline prices and other temporary factors before recovering to around 2.0pc in the fourth quarter.
"Inflation is obviously neither too hot or too cold at this point. It's almost a nonfactor for the bank's next move," said Doug Porter, chief economist at BMO Capital Markets.
"In other words it doesn't really constrain them one way or the other," he said in a phone interview.
The Canadian dollar edged lower, touching C$1.3074 to the US dollar, or 76.49 US cents.
Although two of the Bank of Canada's measures of core inflation remained above 2pc, CPI common - which the central bank says is the best gauge of the economy's underperformance - was unchanged at 1.8pc.
Energy prices fell 4.1pc year-over-year in June as Canadians paid less for gasoline and other fuels. Oil prices dipped amid rising US fuel inventories and the elimination of carbon pricing in Alberta.
But consumers are paying more for other products - notably fresh vegetables, where prices jumped 17.3pc, the largest increase seen since January 2016.
The rise, which follows a similar gain in May, was due in part to inclement weather in agricultural regions.
"The drop in headline inflation isn't going to be the cause of any concern at the Bank of Canada," said Robert Both, macro strategist at TD Securities.
Separately, Statscan said factory sales rose by 1.6pc in May, the most in a year, boosted by strong demand for motor vehicles and parts after auto plants that had temporarily shut down resumed production.