Miley Cyrus danced on Madonna on stage at her MTV Unplugged special, which aired on Wednesday.

Cyrus kicked off the performance singing Madonna's 2000 hit Don't Tell Me before the legend chimed in and walked on stage. Both wore cowboy hats to exemplify the country theme.

The performance led into Cyrus' recent hit We Can't Stop. The two ladies danced on each other and ended the duet with the words "Don't you ever tell us to stop." Madonna also stuck out her tongue along with Cyrus, who has made that her trademark.

"I SPANKED @Madonna (hard) (& she liked it)," Cyrus tweeted the day the performance aired.

PHOTOS: Miley Cyrus Through The Years

The 21-year-old previously explained what encouraged her to include Madonna in her Unplugged special.

"I wanted to have someone here that wasn't the obvious and something that was different than just being on my record, something that people wouldn't really expect," she told MTV News.

"And even I didn't expect Madonna to be necessarily down to do something like Unplugged with me... I grew up listening to Madonna and a lot of what she represented for me is what I try to represent to girls now. Not being afraid of sexuality and really being who you want to be and doing what you want to do."

She also went on to compare We Can't Stop with Don't Tell Me and said both tunes have a similar message.

Aside from her performance with Madonna, Cyrus also sang tracks from Bangerz, her fourth studio album released last October.

Watch the performances here.