Third-seeded Ferrer, the world number four and second-highest remaining seed behind Andy Murray, was poor in the first set, making a succession of errors after an early break.
But the Spaniard, who has already won twice this year after notching seven tournament wins in 2012, fought back in the second, showing his trademark determination from the baseline as he beat back his Austrian opponent.
He then raced through the final set losing just four points on serve and committing only four unforced errors to finish with a flourish.
The loss ended a nine-match winning streak for 42nd-ranked Melzer, who won earlier this month in Dallas.
The Spaniard will meet 15th-seeded Haas, who continued his great form in Florida with a 6-3 6-1 win over French 11th seed Gilles Simon in the late match on Stadium Court.
Haas, who accounted for world number one Novak Djokovic in the previous round, wrapped up the straight-set win in just over an hour.
The German won 80 per cent of his first service points during the opening set before ramping that figure up to 85 in the second.
Haas claimed four of his eight break points chances, while Simon could not muster even one opportunity in a one-sided affair played in slightly better conditions than 24 hours previously, when Haas and Djokovic had to battle the cold and wind.
Miami Masters results
15-Tommy Haas (Germany) beat 11-Gilles Simon (France) 6-3 6-1
3-David Ferrer (Spain) beat Jurgen Melzer (Austria) 4-6 6-3 6-0