(Adds details of release, background)
OTTAWA, July 28 (Reuters) - Canadian producer prices rose 0.5 percent in June largely due to higher prices for energy products and vehicles, Statistics Canada said on Tuesday.
The increase from May was slightly greater than analysts' expectations of a 0.4 percent rise. Fifteen of the 21 commodity groups advanced, with four falling and two remaining unchanged.
Prices for energy and petroleum products rose 2.0 percent last month, thanks largely to a 5.9 percent jump in motor gasoline prices. A weaker Canadian dollar helped boost prices for motorized and recreational vehicles by 1.2 percent.
Some exporters price their goods in U.S. dollars, which means they get more Canadian dollars as the domestic currency loses value. The Canadian dollar weakened by 1.5 percent relative to the greenback in June.
Raw material prices were unchanged in June following a 4.4 percent increase in May. Crude energy product prices posted a third consecutive rise last month, advancing by 1.1 percent, but that was offset by a 3.2 percent drop in prices for metal ores, concentrates and scrap. (Reporting by David Ljunggren; Editing by Paul Simao)