The 69-year-old musician has said earlier this year that he was in talks to play a pivotal role in the 2012 sporting spectacle in London, and now he has confirmed his slot.
"I've been booked. I would be closing the opening on 27 July," Mccartney said while speaking on BBC Radio 5 Live Drive.
Oscar-winning filmmaker Danny Boyle is in charge of the opening ceremony, which is inspired by the theme 'Isles of Wonder'.
The Fab Four icon proved he knows how to put on a scene-stealing finale after closing Queen Elizabeth II's Diamond Jubilee concert in London on Monday.