Michael Jackson didn't know who Pharrell Williams was.

The late musical icon - who passed away in 2009 - invited the N.E.R.D. star to record with him prior to his death, but Pharrell found the invitation strange because he seemed to be unaware of him when he arrived at the studio.

Recalling the encounter, he explained: ''He goes, 'So have you ever been in a studio before?'

''I'm like, 'What? You called me.'

''But I couldn't say that to him. It's Michael Jackson.''

The 42-year-old producer continued to say he wrote several songs for the musician which ended up being given to Justin Timberlake, with their first conversation being when he was in the studio with the 'Cry Me A River' hitmaker.

Speaking on his Beats 1 show, he said: ''The [first] meeting was supposed to be for us to meet to talk about music, and the songs that he turned down, I don't think he realised that I was going to give those songs to Justin.

''So I'm in the studio with Justin, and they say, 'Got a call for you on line one, it's Michael Jackson.'

''So I'm thinking it's one of my friends trying to be funny. And I heard someone eating popcorn in my ear, that's how I know that it's him. He's the king of control, I think he invented it! He's like, 'Hey, okay, you working with Justin? Ah that's really nice, okay cool, well you guys have a great session, tell Justin I said hello!'

''And Justin was like, 'Who was that? Michael? Yeah he does that.'''