(Adds details of release, background)
OTTAWA, June 29 (Reuters) - Canadian producer prices increased by 0.5 percent in May from April, largely due to higher prices for energy and petroleum products, Statistics Canada said on Monday.
The data matched analysts' expectations. Of the 21 commodity groups, three rose, 15 fell and three stayed the same.
Prices for energy and petroleum products jumped by 5.0 percent, mainly thanks to a 7.1 percent advance in motor gasoline prices.
A stronger Canadian dollar cut prices for motorized and recreational vehicles by 0.8 percent. Some exporters price their goods in U.S. dollars, which means they get fewer Canadian dollars as the domestic currency gains value.
The Canadian dollar appreciated by 1.2 percent relative to the greenback in May.
Raw material prices increased by 4.4 percent in May on higher prices for crude energy products, in particular conventional crude oil. The price of conventional crude has grown by 37.2 percent since January.
Reporting by David Ljunggren; Editing by Chizu Nomiyama