(Adds details of release, background)
OTTAWA, Aug 28 (Reuters) - Canadian producer prices unexpectedly rose 0.7 percent in July, the third consecutive monthly gain, on higher prices for motorized vehicles and aircraft, Statistics Canada data indicated on Friday.
Analysts had forecast no change from June. Seventeen of the 21 commodity groups advanced, with two falling and two remaining unchanged.
A weaker Canadian dollar helped produce a 2.5 percent increase in prices for motorized and recreational vehicles as well as aircraft. The value of the currency fell by 4.0 percent relative to the U.S. greenback in July.
Some exporters price their goods in U.S. dollars, which means they get more Canadian dollars as the domestic currency loses value. Had the exchange rate remained constant, producer prices would have fallen by 0.2 percent from June.
Prices for energy and petroleum products dropped by 1.1 percent.
Raw material prices fell by 5.9 percent in July following a 0.2 percent increase in June, pulled down by a 13.0 percent slump in crude energy product prices.
Reporting by David Ljunggren; Editing by Chizu Nomiyama