Pharrell Williams will always regret missing out on working with Michael Jackson after songs he wrote for the King of Pop were rejected and given to Justin Timberlake instead.

The Happy hitmaker penned eight tracks for Jackson more than a decade ago, but the superstar's team rejected the songs and they ended up being used on Timberlake's 2002 debut album Justified.

Williams admits he was deeply disappointed not to have been able to work with Jackson, especially as the superstar later told him how much he liked the tracks.

He tells, "I did eight songs for him that never made it to him, that ended up on Justin's record. Later he sang me all those songs and told me they should have been his and I told him they were for him."

Williams adds of his musical hero, "He is the King of Pop, an incredible dancer, an incredible writer, incredible visionary, he changed the world in so many ways. I am just a fan who has been given the opportunity to make music."

Jackson died from an accidental overdose of anaesthetic in 2009.