The former Beatles singer and guitarist will be the closing act of the opening ceremony.
On Monday, he confirmed: "I've been booked." He told BBC radio station 5 Live that he would be "closing the opening" of the games.
The games begin July 27 and last to August 12.
The opening ceremony is being produced by "Slumdog Millionaire" director Danny Boyle. The ceremony's theme is called "Isles of Wonder."
The Associated Press contributed to this report.