Timbaland almost died of an overdose of painkillers.

The 45-year-old record producer - who has collaborated with some of the biggest names in the music industry, including Jay Z, Justin Timberlake and Katy Perry - has revealed he came perilously close to losing his life three years ago after overdosing on OxyContin, which he became addicted to.

Of his near-death experience, he shared: ''All I can tell you is that there was a light. I woke up trying to catch my breath, like I was underwater.''

Timbaland started taking painkillers over a decade ago because of nerves issue, which he explained stemmed from a gunshot wound he suffered during his teens.

But over a period of time, the chart-topping star developed an addiction to the potentially dangerous painkillers.

He told Rolling Stone magazine: ''Music is a gift and curse.

''Once you're not popping, it plays with your mind. The pills helped block out the noise - I'd just sleep all day. I remember Jay Z told me one time, 'Don't do no more interviews' - because I was saying crazy s**t.''

The producer's addiction eventually started to impact his career, with Timbaland's ability to produce hit records waning.

But having survived his near-death experience, the music star claims he now has a completely different perspective on his life and his career.

Timbaland - whose real name is Tim Mosley - explained: ''Through that whole thing I saw life - I saw where I would be if I don't change, and where I could be if I did.

''I thought about Michael Jackson ... I didn't want to be old and taking these pills.''

Timbaland currently had a number of projects in the pipeline, but the producer says he's also determined to work with up-and-coming artists, too.

He said: ''Right now, I feel like what I can do with my legacy is to give back.

''Which means finding the youth of today. Look at Quincy Jones - he was 50 when he did 'Thriller'! What's my 'Thriller?'''