MONTREAL -- Roger Federer pulled out of next month's Rogers Cup hard-court tournament on Wednesday.

A spokeswoman for Tennis Canada, Valerie Tetreault, wrote in an email to The Associated Press that Federer "wants to make sure he will be (in) top shape for" the U.S. Open, the year's last Grand Slam tournament, which begins Aug. 31.

"I am disappointed that I won't be playing in Montreal because it's a tournament and a city that I really enjoy and has incredible fans," Federer said in a statement released by Tennis Canada. "I hope to be back in the future."

Federer, owner of a record 17 major championships, has not competed since losing to Novak Djokovic in the Wimbledon final on July 12.

Federer, who turns 34 on Aug. 8, won the Rogers Cup twice, in 2004 and 2006, and he was the runner-up a year ago.

"We are obviously disappointed to have Roger withdraw as it is always a privilege to watch him play," tournament director Eugene Lapierre said in a statement. "We also understand his decision because, above all, he has always been very loyal to our event and we would love to see him play tennis for many more years to come."

Play begins Aug. 10 in Montreal. Federer will be replaced in the main draw by Jerzy Janowicz, a semifinalist at Wimbledon in 2013.