Second seed Nikolay Davydenko bounced back from early defeats in his last two tournaments by beating Frenchman Arnaud Clement 6-2, 6-1 to reach the third round.
But all the drama was saved for the evening session when Blake blew five match points against the Spanish world number 57.
The world number five and top seed had two match points in the second-set tiebreak, let slip a 5-2 lead in the third set and then a 4-1 lead in the deciding tiebreak as he was knocked out.
"This one's going to hurt a while," Blake told reporters. "It's definitely shocking, it's frustrating having match points and not winning. I didn't get my first serves in when serving for the match and that's inexcusable."
Hidalgo, in his first hardcourt event of the year, said the key to his win had been how much he enjoyed himself.
"It was fun," he said. "It was a very tough match. I knew I had to play really well to beat James and I did that, it's a great victory for me."
Russian Davydenko, the world number seven, needed just 64 minutes to beat Clement and set up a third-round clash with Paradorn Srichaphan of Thailand, who beat Swiss Stanislas Wawrinka 7-6, 4-6, 6-4.
Clement, who has won two ATP Tour titles this year, was outplayed from the start as Davydenko broke his serve five times to cruise into the last 16.
The Russian won a claycourt event in Sopot, Poland this month, but lost in the first round in the Masters Series events in Toronto and Cincinnati.
"Changing from clay courts to hard courts is difficult because they are very different," Davydenko said.
"Okay, in Toronto I had no chance because I had just arrived and in Cincinnati I played very bad.
"Even today I was not feeling good at the start but I got better and better and, hopefully, now I can win some matches so I can go to the U.S. Open with some confidence."
GOOD DAY
It was generally a good day for seeds with 14 of the 15 in action advancing to the last 16, even though number three Marcos Baghdatis of Cyprus and number five David Ferrer of Spain both survived tough tests.
Baghdatis beat German qualifier Michael Berrer 7-6, 7-6 and Ferrer edged out American Mardy Fish 6-2, 2-6, 7-6.
Fourth seed Jarkko Nieminen beat Briton Greg Rusedski 7-6, 6-4 and sixth seed Jose Acasuso and number 12 Juan Ignacio Chela set up an all-Argentine third-round match.
Acasuso won when Nicolas Mahut of France was forced to retire with a groin strain midway through the second set, while Chela crushed Italian Andreas Seppi 6-3, 6-2.
Seventh seed Fernando Verdasco beat Frenchman Julien Benneteau 7-6, 6-4.