The Pirates of the Caribbean actor was there to receive the 'Generation Award', honouring him for his career in movies including Edward Scissorhands and Fear and Loathing in Las Vegas.
> MTV Movie Awards 2012: Live blog
Aerosmith band mates Joe Perry and Steven Tyler presented Depp with the award, with Perry describing the actor as "a gutsy actor, a gutsy musician, and gutsy artist with passion".
Depp then wowed the crowd by playing a song on guitar with The Black Keys. Depp dropped out of school at the age of 15 to pursue music, before then deciding to focus on acting.
After performing, the actor thanked MTV for the award, saying: "I gotta thank MTV for this... it's an honour to be presented by these two legends, and these up and coming legends The Black Keys."
Depp is currently working on a remake of The Lone Ranger with Armie Hammer in New Mexico.
The MTV Movie Awards 2012 first aired live from the Gibson Amphitheatre in Universal City, California in the US. The ceremony will air on Monday, June 4 at 9pm in the UK.
> 'Hunger Games', 'Twilight', 'Harry Potter' win at MTV Movie Awards 2012
> MTV Movie Awards 2012: The winners in full
Watch Johnny Depp playing guitar on 'Lonely Boy' below (US users only):