Find out all of the details on the crystal-embellished cowboy hat designed by Eric Javits that Madonna wore for her appearance with Miley Cyrus on MTV Unplugged. Credit: Jeff Kravitz/FilmMagic for MTV

Madonna brought on the bling for her instantly historic duet with Miley Cyrus for the MTV Unplugged special that aired Wednesday, Jan. 29.

While performing a medley of Madonna's 2000 hit "Don't Tell Me" and Cyrus' 2013 smash "We Can't Stop" during the Western-themed show, the two divas wore bedazzled cowgirl-inspired outfits. The most mesmerizing accessory, though, was Madge's black cowboy hat featuring 1,200 Swarovski crystals that took more than 30 hours to make.

The custom piece was designed by celebrity milliner Eric Javits, who worked with Madonna's stylist for the show, B. Akerlund, to come up with a glamorized version of the Western hat. Inspired by bucking broncos and rodeos, Javits arranged the crystals along the brim to create a sense of movement. "The jewel embroidery infuses this classic American shape with couture elegance," Javits says. "And brings the focus to Madonna’s eyes.”

During the performance, Cyrus, 21, and Madonna, 55, dirty-danced their way through the duet, with Cyrus even spanking Madonna's butt. "That was pretty f---ing cool, you guys," Cyrus told the audience after. "It sounds super-lame, but as a pop star it's pretty cool performing with Madonna."