The host of the show, Miranda Hart, managed to rope the Duke of Cambridge into recreating a “posh party” just minutes into the programme.
After the audience completed their part, the 35-year-old shouted out “such fun” from the royal box where he sat alongside his wife Kate Middleton.
Later on, he made viewers’ night as he joined in with Miranda’s favourite activity – galloping.
The comedian got a member from the cast of Annie to ask the second-in-line to the throne to partake.
William’s head fell into his hands at the request but he soon got up and galloped on the spot whilst Kate burst out laughing.
Those watching the show heaped praise on the father-of-two for being a “great sport”.
One person wrote on Twitter: “Prince William galloping has made my year #RoyalVarietyPerformance #2017made.”
“Only Miranda Hart would be able to get Prince William to gallop #RoyalVarietyPerformance,” another added.
A third gushed: “Love #PrinceWilliam what a great sport #RoyalVarietyPerformance!!”
“I do love Prince William he always gets involved #RoyalVarietyPerformance,” said one viewer.
On the night many acts including Paloma Faith, Leading Ladies, Seal and Britain’s Got Talent winner Tokio Myers performed.
The Royal Variety Performance is now available on ITV Hub.