Watch Miley Cyrus and Madonna duet for MTV's "Unplugged"

Madonna and Miley Cyrus perform onstage during "Miley Cyrus: MTV Unplugged" at Sunset Gower Studios on Jan. 28, 2014, in Hollywood, Calif.
Christopher Polk/Getty Images for MTV

Miley Cyrus mixed her wild child persona with her country roots for her MTV "Unplugged" concert special, which premiered Wednesday night, and closed it out with some help from Madonna.

The Queen of Pop, 55, joined the 21-year-old Cyrus for a mashup of their hits "Don't Tell Me" and "We Can’t Stop."

Both were dressed in cowgirl outfits with matching hats, and threw some line dancing into their duet. Madonna also grinded on Cyrus and the young star spanked the music icon.

"It sounds super-lame, but as a pop star it's pretty cool performing with Madonna," Cyrus told the audience after their performance. She also shared her excitement on Twitter, writing, "I SPANKED @MADONNA (hard) (& she liked it)."

The "Unplugged" special also included her hit "Wrecking Ball" and a cover of her godmother Dolly Parton's "Jolene." Watch those performances below: