The world number two, who recently won a record seventh French open title, his 11th Grand Slam victory overall, was the unanimous choice of the Spanish Olympic Committee (COE).
"To carry the Spain flag representing all the Spanish Olympic competitors in London is a true honour," the 26-year-old said in a statement.
"All I can do is thank all the heads of the Olympic federations who have given me this opportunity.
"To carry this flag will be one of the most emotional moments I am going to have in my whole career and I believe it is a recognition for what I have achieved over the years.
"All I can do is say thank you and wish all the athletes the very best."
COE president Alejandro Blanco praised the decision.
"They didn't only consider sporting achievements, but also the current standing of the individuals, and their relevance at a national and international level," Blanco said."It had to be Rafa Nadal."
Nadal will succeed former Olympic canoeing champion David Cal who led the Spanish contingent in Beijing.
The Mallorca native will be attending his third Olympics after competing in the doubles in Athens in 2004, and winning the singles in Beijing four years ago.
World number one Novak Djokovic will carry Serbia's flag at the opening ceremony on July 27.
- Sports & Recreation