The June inflation rate was up from 7.7% in May and marked the largest yearly change since January 1983.
Excluding gasoline, the inflation rate was 6.5% in June compared with 6.3% in May.
Canadians also continued to see higher food prices, with the cost of food up 8.8% compared with June last year.
Among food items, the largest increase in prices was for edible fats and oils, which rose by 28.8% year-over-year.
With public health restrictions easing and more people looking to travel in June, the cost of travel-related services surged. Prices for accommodation rose by about 50% across the country compared with a year ago.
"The return of sporting events, festivals and other large in-person gatherings has resulted in higher demand for accommodation, particularly in major urban centres," Statistics Canada said.
On a month-over-month basis, the consumer price index edged higher by 0.7%, largely due to rising prices for gasoline and travel accommodations.
After declining slightly in May, air transportation costs rose 6.4% month-over-month.
In the face of concerns from consumers and businesses that high inflation will persist for several years, the Bank of Canada is ratcheting its efforts against rising inflation. In its most recent rate decision, the central bank opted to hike its key interest rate by a full percentage point, the largest single increase since 1998.