Swift, 23, and Jovi, 51, were at the Kensington Palace in London on November 26 to attend the Winter Whites Gala, which was held to raise money in support of homeless charity Centrepoint, which William has been a patron since 2005, reported Daily Express.
Jovi was in the middle of performing the song on the stage when he invited William to join him.
The Prince accepted the invitation insisting that Swift, who had performed earlier, should also accompany him. The trio made a fun and unforgettable version of the classic tune.
The country singer was also happy to have performed at the royal place.
"I am so excited. I don't think I have ever played in a palace before. So it will be really wonderful. It's positively magical here. There are fairy lights and there is fake snow falling from the sky and everything is just gorgeous," Swift said.
"I am just very lucky to be here. This evening is so special... It is for a charity that as well as being very important to Prince William is also very important to me," she added.