'Will you be here all night long?': King and Queen in American Idol surprise with Lionel Richie and Katy Perry

The King shared a joke with Lionel Richie as he and the Queen joined the singer for a surprise appearance on the hit US show American Idol.

The King jokingly asked the star if he was going to be using one of the halls at Windsor Castle "all night long" - a nod to one of the singer's hits - following his performance at the coronation concert on Sunday night.

He made the gag after walking on camera with Queen Camilla while Richie, 73, and concert co-star Katy Perry delivered their review of the night to American Idol host Ryan Seacrest.

After making the joke, the chuckling King added: "I just wanted to check how long you'll be using this room for?"

He also thanked the pair for their performance, which was watched by the Royal Family and a 20,000-strong crowd outside Windsor Castle.

Coronation latest:
Updates as royals out and about volunteering
Louis, George and Charlotte steal the show

"Thank you so much for your brilliant performance, and Katy, it was wonderful, it really was. A great treat to have you both here," the King said.

The Queen, wearing an electric blue jacket, also praised the pair, adding: "Fantastic, absolutely fantastic."

She also complimented Perry on her bright green off-the-shoulder silk dress, adding: "Love your frock."

Perry, 38, asked the Queen if they were making "too much noise" and the pair joked quietly together.

Richie said: "We understand there's a party... you're throwing the party right next door."

Read more:
The best of Windsor's coronation concert
'This is boring': King caught on camera before coronation
Tom Cruise delivers special mid-air message to King
Queen Elizabeth II 'would be proud mother'

The King replied: "Ah you've heard about that... we better take you to that, but you are busy with all these other things."

"As soon as we finish, we're coming to the party," Richie said.

As the King and Queen walked off, Richie added: "We love you guys, and congratulations."

The episode of American Idol - one of the most popular shows in America - also saw British singer-songwriter Ed Sheeran perform the live TV debut of his song Eyes Closed from his latest album.

The King and Queen were joined by about 20,000 members of the public at the musical extravaganza, which opened with Feel The Love by Rudimental - a track handpicked by the King himself.

There were also performances by Olly Murs, Take That and Nicole Scherzinger, before the Prince of Wales took to the stage where he expressed his pride in his "Pa".

Top Gun star Tom Cruise also appeared via a pre-recorded video at the Windsor show, calling the King his "wingman".