It was a moment she could not pass up.

But when Katy Perry took the opportunity to join the original queen of pop Madonna onstage at her star-studded concert in Los Angeles a quick rehearsal may have helped.

On Wednesday, the morning after her appearance onstage, the 31-year-old shared a hilarious video of duo’s awkward – and very improvised – dance routine onstage.

Scroll down for video

Awks! Katy Perry shared a hilarious video from her night of dancing onstage with Madonna

Awks! Katy Perry shared a hilarious video from her night of dancing onstage with Madonna

In the short clip, the Roar singer briefly twerks against Madonna before the 57-year-old begins hopping around her awkwardly like a frog.

The dance culminates with Katy booty bouncing against the Material Girl one last time.

Fully self-aware, the Dark Horse singer captioned her post: ‘Well, that was unrehearsed’.

Katy Perry and Madonna drop it low while dancing on stage

'That was unrehearsed': On Wednesday, the morning after her appearance onstage, the 31-year-old shared a hilarious video of duo's awkward - and very improvised - dance routine onstage

‘That was unrehearsed’: On Wednesday, the morning after her appearance onstage, the 31-year-old shared a hilarious video of duo’s awkward – and very improvised – dance routine onstage

A little awkward: In the short clip, the Roar singer briefly twerks against Madonna before the 57-year-old begins hopping around her awkwardly like a frog

A little awkward: In the short clip, the Roar singer briefly twerks against Madonna before the 57-year-old begins hopping around her awkwardly like a frog

Fully self-aware, the Dark Horse singer captioned her post: 'Well, that was unrehearsed'

Fully self-aware, the Dark Horse singer captioned her post: ‘Well, that was unrehearsed’

But still added a shout out to the legendary pop star: @madonna my Queen’. 

Katy, who only recently wrapped her 151-date tour, was invited by Madonna on stage to toast a successful night, following her wildly entertaining Rebel Heart gig at The Forum in Los Angeles, California.

The meeting appeared to be too much for the chart-topper as she was pictured welling up in front of the audience which included the likes of Ashton Kutcher, Mila Kunis, Queen Latifa and Salma Hayek.

Dream: Despite being unprepared, the Firework singer could not pass up the opportunity to dance with one of her heroes

Twerk it: The dance culminates with Katy booty bouncing against the Material Girl one last time

Twerk it: The dance culminates with Katy booty bouncing against the Material Girl one last time

However, it was perhaps a genuine case of having something in her eye as the veteran performer instructed her to take a shot from a banana-shaped flask and it’s possible some fluid squirted into her eye as she struggled to open it.

Once Katy freed the lid, she sniffed it before braving a taste of the unknown concoction.

Katy was dressed in a form-flattering little black dress which was almost business in style. 

Eww: Katy couldn't hide her disgust as Madonna made her down a shot on stage at her star-studded Rebel Heart concert in Inglewood, Los Angeles, on Tuesday evening

Eww: Katy couldn’t hide her disgust as Madonna made her down a shot on stage at her star-studded Rebel Heart concert in Inglewood, Los Angeles, on Tuesday evening

Totes emosh: Katy, 31, appeared to be welling up after tasting the 57-year-old's offering

Totes emosh: Katy, 31, appeared to be welling up after tasting the 57-year-old’s offering

Something in your eye? Katy, 31, was invited to toast the successful concert by taking a sip from a flask shaped like a banana

Something in your eye? Katy, 31, was invited to toast the successful concert by taking a sip from a flask shaped like a banana

The struggle is real: The Roar singer seemed to be having difficulty loosening the flask lid

The struggle is real: The Roar singer seemed to be having difficulty loosening the flask lid

The smell test: Katy sniffed the concoction before braving a taste

The smell test: Katy sniffed the concoction before braving a taste

The smell test: Katy sniffed the concoction before braving a taste

An interesting finale: Madonna explained what was about to happen while Katy awaited her cue

An interesting finale: Madonna explained what was about to happen while Katy awaited her cue

Over to you: The pop princess handed the object to the star of the show who was tasked with following her lead

Over to you: The pop princess handed the object to the star of the show who was tasked with following her lead

No escaping: Katy fixed her earring while she waited for Madonna to show her up on stage

No escaping: Katy fixed her earring while she waited for Madonna to show her up on stage

A bit of encouragement wouldn't go amiss: The Prism star got the crowd going as Madonna braved the funky mixture

 

A bit of encouragement wouldn't go amiss: The Prism star got the crowd going as Madonna braved the funky mixture

A bit of encouragement wouldn’t go amiss: The Prism star got the crowd going as Madonna braved the funky mixture

Where she belongs: Katy whooped and cheered as Madonna desperately tried to avoid repeating her error

Where she belongs: Katy whooped and cheered as Madonna desperately tried to avoid repeating her error

Courting controversy: Madonna encouraged Katy and her dancers to flip the bird to gig-goers following the drinking segment

Courting controversy: Madonna encouraged Katy and her dancers to flip the bird to gig-goers following the drinking segment

No VIP treatment: Katy proved how done to earth she is by joining the public crowd as opposed to requesting a special spot in the wings

No VIP treatment: Katy proved how done to earth she is by joining the public crowd as opposed to requesting a special spot in the wings

High spirits: It was clear the Dark Horse songstress was enjoying herself at the gig

High spirits: It was clear the Dark Horse songstress was enjoying herself at the gig

High spirits: It was clear the Dark Horse songstress was enjoying herself at the gig

Playful display: Katy flipped the bird in jest as she listened to Madonna belt out her best hits

Playful display: Katy flipped the bird in jest as she listened to Madonna belt out her best hits