07/19/2012 at 11:00 AM EDT
will not be competing in the London Olympics, he announced Thursday.
"I am not in condition to compete in the London Olympics and therefore will not travel as planned with the Spanish delegation to take part in the Games," he said in a statement to the Associated Press.
"I have to think about my companions, I can't be selfish and I have to think of what's best for Spanish sport, especially tennis and Spanish players, and give fellow sportsmen with better preparation the chance to compete."
Nadal – who won the men's singles gold medal at the 2008 Beijing Olympics – has been battling knee problems for years. Still, he continued to prepare for the Olympics until as recently as this week.
"I tried to hurry my preparations and training to the very last minute, but it was not to be," he said in his statement.
But earlier this week, he documented his training progress online. "Stretching after the practice, more and more eager to arrive to London!" he wrote on his Facebook page
Nadal also said recently that he was "doing everything possible to recover" after competing at Wimbledon
. "The hopes are at a maximum, the work is total and I expect to be at 100 percent," he said last Saturday.
Nadal, ranked number three in the world after Wimbledon, had been selected to carry the Spanish flag at the London Olympic Games.