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.