Justin Timberlake says 'SexyBack' was inspired by 'Rebel Rebel'.

The 39-year-old singer has opened up about his huge 2006 hit, and he admitted he took some influence from David Bowie's classic song when it came to writing the dance track.

Speaking to Apple Music's Zane Lowe about his own 'Essentials Playlist', he said: ''I was listening to 'Rebel Rebel,' which essentially is about a cross-dresser.

''And so I was picturing guys, girls, all iterations of that in a club, singing this to each other. And I said, 'This has to be so simple and a vibe and just like an attitude.'

''And I was like, 'What's the most audacious thing you could possibly say?' And that was the first line of the song.''

JT recalled working with producer Timbaland on the track, and how it all came together in the studio.

He added: ''I'll never forget this moment. So [Timbaland's] like, 'All right man, I think we got to bring dance music back.'

''So he's [beatboxing]... He's like, 'Whatchu you gonna say?' I just go like this, [singing] 'I'm bringing sexy back!' And he goes, 'Yeah!' He just said 'Yeah!'

''But Timbaland doesn't do anything off-beat. You should know that... So then we just started trading lines back and forth and it was just, it honestly, it was like a pop-dance cipher.''

Justin admitted the pair both knew they'd create something ''different'', and the reaction from people in the studio only boosted their confidence.

He explained: ''You know, where we were, everything was off the top of the head, and we were just going. And then we finished it, we knew it was different.

''We would invite people to the studio. And every time that record came on, the reaction you got from any female was, I was like, 'This is it.' ''