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.
In Pictures: Sex scandals involving Indian politicians
Photos: Sports stars who shocked the world with their retirement
Photos: Abhishek Bachchan and Farah Khan at Boman Irani's birthday bash
Spotted: Shah Rukh Khan at Morani's bungalow in Mumbai
Spotted: Sonam Kapoor and sister Rhea at Mumbai airport