By Paul Vieira

OTTAWA--Inflation expectations in Canada zoomed upward in the second quarter due to the anticipated impact on elevated energy costs from the conflict in Iran, according to a quarterly business-outlook survey from the Bank of Canada.

The survey indicated that expectations for higher prices--both what firms pay for inputs and what they intend to charge their customers--are at a level last recorded in early 2023.

The second-quarter business-outlook survey, published Monday, represents key data that senior Bank of Canada officials will take into account when they deliver their latest rate-policy decision on July 15, or in nine days. The bulk of the survey was conducted in May, or before the U.S. and Iran struck a deal to allow oil-tanker traffic to resume through the Strait of Hormuz.

The central bank's survey acknowledges that some responses recorded in June indicated a notable cooling in inflation expectations, following the pact between Washington and Tehran. Bank of Canada Gov. Tiff Macklem said in late June that the truce in the Middle East does remove some of upside risk on inflation.

The Bank of Canada sets rate policy to achieve and maintain 2% inflation, or the midpoint of a 1% to 3% target range. Inflation accelerated in May to a two-year high of 3.2%, although Macklem said there was limited evidence of higher energy prices spreading to other goods and services.

Some economists had anticipated the survey results could be somewhat stale on arrival. "Inflation expectations could be a look in the rearview mirror given where energy prices stand today," Shelly Kaushik, an economist at BMO Capital Markets, said in a note prior to the survey's release. A barrel of crude oil is now trading in the $69 range, whereas in May, when the central bank survey was conducted, the price traded in a range between the high $80 level to nearly $110.

Still, Kaushik said the survey could provide "a glimpse into how much businesses expected their higher input costs to flow through to output prices."

According to the survey, the share of respondents anticipating inflation hovering over 3% over the next two years rose surged in the second quarter to 44%, from the previous quarter's 11% level. Expectations among firms for growth of both non-labor input costs and selling prices over the next year increased considerably, according to the survey, based on findings collected via phone and video interviews from May 1 to May 21.

The survey also reported that firms' sales outlooks softened slightly, reflecting a slowdown in business and consumer spending associated with rising fuel-related costs.

Canada's economy rebounded in April, according to Statistics Canada, and is on track for growth of more than 2% annualized in the second quarter. This offers some relief to policymakers after two straight quarters of economic contraction--although Bank of Canada officials debunked talk of a recession, according to minutes of their latest deliberations.

The Bank of Canada has kept its main interest rates steady at 2.25% since the fall of last year, and most economists expect no change from the central bank through 2026. Central bank officials say that scads of spare capacity are prevalent in the economy. According to the most-recent minutes, published last month, Bank of Canada policymakers said they did not want to overreact to the jump in energy prices, but also didn't want to be slow to react any spillover that might accelerate a pickup in inflation.

Write to Paul Vieira at paul.vieira@wsj.com