"Dirty Dancer" was written by Enrique Iglesias, RedOne, Evan Bogart, Erika Nuri and David Quiñones, and was produced by RedOne. It was recorded at South Point Studios, Miami. "Dirty Dancer" is a dance-pop song with some influences of electropop, dubstep, and rave music. According to Adam Graham of MTV News, "Dirty Dancer" is about "a comely-yet-dangerous female"; its hook features the lyrics "She's a dirty, dirty dancer/ Dirty, dirty dancer/ Never ever lonely". At the beginning on the song, Usher dedicates it to "the dirty girls all around the world". Iglesias and Usher exchange verses before, on the single remix, Wayne gives his rap verse, which makes a reference to actor Eddie Murphy. "Dirty Dancer" was included on Iglesias' sixth studio album, Euphoria, and Usher's EP Versus. "Dirty Dancer" was sent to Australian contemporary hit radio (CHR) and nights radio on May 9, while the single remix was sent to US CHR May 10. The single was released as a music download in North America on June 12, 2011, and was released in Europe and Oceania on June 19.
Robert Copsey from Digital Spy and Allison Stewart from The Washington Post chose "Dirty Dancer" as one of the best tracks on Euphoria, with Stewart calling it "steamy". Prefix Magazine's Wilson McBee criticized Wayne's appearance on the track, and wrote that the line "Ain't no money like young money" was his "weakest last line ever".
The album version of "Dirty Dancer" debuted at number 194 on the UK Singles Chart on July 17, 2010, and at number fifty-one on the Dutch Single Top 100, where it later peaked at number thirty-nine. The album version also entered the Slovakian Radio Top 100 Oficiálna at number ninety-four in May 2011, as well as appearing on the Belgian Ultratip charts of Flanders and Wallonia at numbers nine and thirty-six, respectively.
On August 12, 2011, the song charted at #1 on the Billboard Hot Dance Club Songs making it his ninth #1 single on the chart. He is the only male artist in the chart's history to achieve this milestone, beating previous record-holder Michael Jackson. It is his third consecutive #1 on this chart from his album Euphoria, following "I Like It" and "Tonight (I'm Fuckin' You)".
Enrique Iglesias first premiered "Dirty Dancer" live as part of a medley with "I Like It" that he performed on the tenth season of American Idol on May 12, 2011. For the performance, he wore blue jeans and a black leather jacket, which featured Usher and Lil Wayne appearing on video screens behind backing vocalists and a band. Initially, Iglesias was under a lone spotlight, before several green lasers beams lit the stage.
The music video for "Dirty Dancer" was directed by Yasha Malekzad, Jeff Dotson & Ethan Lader and premiered on June 22, 2011. It opens by showing a city during the night, and Iglesias making his way to a futuristic strip club, who then watches a holographic pole dancer performing a gymastic routine while wearing a black latex outfit. Usher is shown donning black clothing and sings alone in a dark room. Throughout the video he alternates between reality and a holographic. Iglesias is shown in similar scenes, and at one point lowers his jacket to expose his blue luminous heart. Iglesias presses buttons on a remote control and the dancer is replaced by another, dressed in silver, who is in turn replaced by a gold bikini-clad dancer. Wayne begins his verse while being projected onto a building, while other shots show him in a dark room, similar to those of Usher. The dancer whom Iglesias watches leans in to kiss him but is replaced by a holographic message reading "credit expired". Sabrina Cognata of WNOW-FM wrote, "This video has everything. And I mean everything worth having." MTV Buzzworthy's Jenna Hally Rubenstein wrote, "If you want to be a baller, this video is how you do it." The video has been viewed 77 million times.