Even world No. 1 Rafael Nadal was pushed to a third set before he claimed a 6-3, 6-7 (3-7), 6-3 win over Tobias Kamke.
Ferrer, No. 3 in the world, was taken out by Daniel Brands, who finished off both of his second-set break chances to finish off the upset.
Murray, fourth in the rankings, opened his tournament with a 6-0, 6-0 romp in the first round and was up a set and a break on Florian Mayer. But Mayer won 12 of the next 15 games, a run that included winning 62 percent of the points in the third set as he beat Murray for the first time in his career.
Gasquet, ninth in the world, was a 6-2, 7-5 victim to French countryman Gael Monfils, as he only managed one break point on the day. It was the ninth meeting between the two and fifth time Monfils won.
Other upsets Wednesday saw qualifier Peter Gojowczyk edge sixth-seeded Philipp Kohlschreiber and Victor Hanescu eliminate No. 8-seeded Fernando Verdasco 4-6, 7-6 (7-0), 6-2. Even the lone match without a seeded player was an upset as qualifier Dustin Brown took out Ivo Karlovic 3-6, 7-5 (15-13), 6-4.
No. 7-seeded Ernests Gulbis came away a 6-2, 4-6, 6-3 winner over Lukasz Kubot and will meet Nadal in the quarterfinals.
Brown and Gojowczyk -- the two qualifiers -- will play in the other quarterfinal in Nadal's half of the draw. Also set against each other are Hanescu and Mayer, while Monfils and Brands complete the quarterfinal pairings.
Swim Week Miami Beach 2014 [PHOTOS]