Starbucks will raise the price of packaged coffee by 17 percent in its U.S. and Canadian stores on July 12.

It is responding to escalating coffee prices, which have almost doubled over the past year and are trading at 30-year highs. On Tuesday, J.M. Smucker Co. said it will raise the price of Folgers coffee by 11 percent - the latest of four price increases over the past year.

Although Starbucks CEO Howard Schultz has said repeatedly that he believes speculators are driving the price of coffee and other commodities beyond what they are worth, the chain decided it could not wait any longer to pass the higher costs along to customers.

In March, it raised the price of packaged coffee sold in grocery stores by an average of 12 percent, and last fall it hiked prices on some drinks in some cafés. Prices on some drinks also fell.

"We held off as long as we could," Starbucks spokesman Alan Hilowitz said of the latest increase. "We want to provide value to our customers, so we only do it when we really have to to effectively run the business."

The price on a pound of Starbucks' house blend will increase by $2 to $11.95 in July. High-priced coffees, such as Anniversary and Christmas blends, will increase a dollar to $14.95.

It is the first time Starbucks has raised prices on packaged coffee in cafés since 2009. The company will recommend price increases at thousands of cafés in airports and grocery stores that it licenses but that set their own prices.

Starbucks cafés in Canada will implement a 6 percent price increase in July, their first since 2007.

Last year, Starbucks stopped reporting the average price it pays for coffee. The last available figure was $1.49 a pound for 2008, which was up from $1.20 a pound in 2002.

On the commodity market, coffee is now selling around $3 a pound.

The company locks in the price it pays for coffee early, which protected it against rising prices for a while. But the contracts it has now are at the new, higher prices, Hilowitz said.

He said he did not know if Starbucks would lower prices if coffee costs fall.