WINSTON-SALEM, N.C. -- Sam Querrey wants to get in as many matches as he can to prepare for next week's U.S. Open.

Yet Querrey nearly saw his preparations come to an early end Wednesday, struggling early before edging Finland's Jarkko Nieminen 4-6, 7-6 (7), 7-6 (10) to advance to the Winston-Salem Open quarterfinals.

"It's kind of the last hurrah here and next week to put together some results," Querrey said. "I've played two good matches, and hopefully I've got a chance to play another one (Thursday). Every match is big for me right now. I'll take every one of them I can get."

In the night match at the Wake Forest Tennis Center, France's Gael Monfils took advantage of two key service breaks in the third set to beat 22nd-ranked Tommy Robredo of Spain 7-6 (7), 4-6, 6-2.

Monfils, who was ranked seventh in the world in 2011, broke serve in the third and seventh games of the final set to get a measure of revenge over Robredo, who rallied from a two-set deficit to beat Monfils at the French Open nearly three months ago.

"I started to feel better with the ball," said Monfils, who will face Spain's Fernando Verdasco, a 6-4, 6-7 (10), 6-3 winner over Robin Haase of the Netherlands. "When I broke him, I had to take a bit more time and focus more on my first serve. He started to play more defensive and make me run, but I knew I could win this one."

Querrey had 19 aces, but lost the first set to the left-handed Nieminen after leading 4-1. Querrey then had to overcome five match points in the third-set tiebreaker to advance to his fourth tournament quarterfinals this season.

"I just played some sloppy points (in the first set)," Querrey said. "I missed a few when I was up 4-2, and I missed some easy forehands later on. That kind of got me down, and it took a while for me to get back into it.

"That was just a lack of confidence right out of the gate ... but I knew that if I could get into a tiebreaker, I could win my serve and grind out a few points on his serve."

The 29th-ranked Querrey will face unseeded Ricardas Berankis of Lithuania, a 6-3, 6-3 winner over Spain's Roberto Bautista Agut.

"It's always painful to lose a tight match," said Nieminen, who had advanced past the round of 16 five times this season, but not since mid-May. "When it got to 6-6 (in the third-set tiebreaker), I saw that he looked tired. That's when I stopped playing the way I did before, and missed some shots. I wanted to make him run, but I should have gone for my shots like I did before."

Querrey is the lone American remaining in the final hard-court tournament before the U.S. Open next week.

Qualifier Steve Johnson, who upset second-seeded Andreas Seppi of Italy on Tuesday, lost to Taiwan's Yen-Hsun Lu 6-3, 6-2.

In other third-round results Wednesday, Jurgen Melzer of Austria beat Frenchman Benoit Paire 6-4, 6-3; Dmitry Tursunov topped fellow Russian Alex Bogomolov Jr. 6-3, 7-5; and Alexandr Dolgopolov of the Ukraine edged Argentina's Juan Monaco 4-6, 6-3, 6-3.