World number four Murray beat Anderson 6-4 3-6 6-3 to become the 46th man in the Open Era to reach 500 career wins and the first British male. He is one of only nine active players to have reached the milestone.
Anderson fought back well in the second set but after trading early breaks in the third the Scot took control, breaking his South African opponent again to grab a 3-1 advantage and never looked back.
Murray will face Austrian Dominic Thiem, who reached his first Masters 1000 series quarterfinal after beating France’s Adrian Mannarino 7-6 (5) 4-6 7-5.
Berdych will next face Argentine Juan Monaco, a 6-3 6-3 winner over Spaniard Fernando Verdasco.
Japan’s Kei Nishikori, the fourth seed, beat Belgian David Goffin 6-1 6-2 and will face American John Isner, who beat Canada’s Milos Raonic in three tie-breaks.
Isner trailed by a set and was 3-0 down in the second but emerged from the battle of two of the game’s biggest servers with a 6-7 (3) 7-6 (6) 7-6 (5) victory.
Defending champion Novak Djokovic survived a scare from Alexandr Dolgopolov yesterday to reach the Miami Open quarterfinals.
Djokovic was made to work for his 7-6 (3) 7-5 6-0 win over world number 65 Dolgopolov.