Murray captured his 26th career tour title, and second of the year having taken the Brisbane crown, after a grueling two hours and 45 minutes.
“Both of us fought hard,” Murray said. “Both of us were struggling physically at the end. I was lucky to come through.”
It was the second Miami title for Murray, who won the title in 2009 but lost last year’s final to Novak Djokovic.
Murray will rise to World No 2, bumping his way ahead of Roger Federer, while Ferrer will move past Rafael Nadal to become fourth.
Spotted: Aditya Roy Kapur with his mother in Bandra
In pictures: Bollywood celebs who share birthdays
'Kahaani 2' trailer launch photos: Vidya Balan takes an auto ride
Photos: Priyanka Chopra's family, celebs watch 'Ventilator' at MAMI
Photos: Raveena Tandon, Sohail Khan at Marathi film 'Bhay' music launch