The singer was asked by the bridegroom to perform, according to Kensington Palace.
It said in a statement: “Sir Elton performed for the newly married couple in recognition of the close connection he has with Prince Harry and his family. “
The star was in attendance at Windsor Castle’s St George’s Chapel earlier with his husband David Furnish to watch as the royal bridegroom wed his American love.
He was spotted in the chapel ahead of the service chatting with fellow celebrities including David and Victoria Beckham.
The Palace gave no further details of the performance.
Sir Elton has a close relationship with Harry and his brother, the Duke of Cambridge, and was friends with their mother, Diana, Princess of Wales.
In 1997, he famously sang a re-worked version of his hit Candle In The Wind at the princess’s funeral, changing the words to Goodbye England’s Rose.
In a TV interview in June, 2008, he told how singing at the funeral was a surreal experience.
He said: “What was going through my mind was, ‘Don’t f*** this up. Don’t sing a wrong note. Don’t sing the wrong note. Be stoic.
“Don’t break down and just do it to the best you can possibly do it without showing any emotion whatsoever’.”
The singer was also present at William’s wedding to the Duchess of Cambridge in 2011.
He was present at Saturday’s celebrations fresh from finishing a Las Vegas residency which ran for 450 shows over a seven-year period.