The singer's inspiration for the track, from his upcoming album Unorthodox Jukebox, came from a night out at a strip club in Paris, France, with producer Diplo.
Speaking about the track, Bruno recalled: "That's the wild card. Diplo has all the sounds in his computer to make the club go wild. We actually wrote that to be a strip-club anthem.
"After a concert in Paris, we went to a strip club; the promoter got on the mic and said, 'We have a special guest, Bruno Mars!' - And then they played Just the Way You Are.
"That's the worst song to hear in that environment, so I resolved to write a good one."
Breaking boundaries
Diplo, who has also worked with MIA and Beyoncé, praised Bruno for breaking the boundaries on the song and shared his respect for his songwriting skills.
Speaking in an interview with Rolling Stone Diplo said: "In our generation, he's the most talented guy I've worked with.
"That record, he wanted to have something for the club that has some noise on it and an 'I don't give a fuck' feel. Still, he writes giant pop songs.
"Bruno just does things with the songwriting I could never do - I've never spent so much time working on a bridge or post-chorus, but that's what you have to do."