NEW YORK — Roger Federer regrouped after a fortuitously timed rain delay to move on at the U.S. Open in four sets Sunday.

The second-seeded Federer was a game from losing the first set to Marcel Granollers in the third round Sunday when play was stopped because of lightning. After they returned to the court two hours later, Granollers won the set, but Federer dominated the rest of the way in a 4-6, 6-1, 6-1, 6-1 victory.

Drenched with sweat on a humid night, Federer acknowledged that the break helped him. He started serving better in the final three sets.

The 42nd-ranked Granollers was looking to make the fourth round at the U.S. Open for the second straight year.

Caroline Wozniacki wore down Maria Sharapova to win in three sets and return to a Grand Slam quarterfinal for the first time in more than two years.

Wozniacki beat the five-time major champ 6-4, 2-6, 6-2 in 2 hours, 37 minutes on a steamy Sunday. Sharapova received a time violation warning when she came back to the court too late from the break before the final set. Wozniacki later complained to the chair umpire that her opponent was taking too long between points.

The 10th-seeded Wozniacki, who plans to return to New York in two months to run a marathon, looked far fresher than Sharapova, who’s usually the one outlasting foes.

With the fifth-seeded Sharapova’s loss, No. 1 Serena Williams is the only top-six woman left.

Fourth-seeded David Ferrer became the first top-10 seed to fall in the men’s draw, losing to Gilles Simon 6-3, 3-6, 6-1, 6-3 in the third round Sunday.

Simon, seeded 26th, confounded Ferrer with a variety of shots that kept him out of sync. Ferrer piled up an uncharacteristic 52 unforced errors, nearly twice as many as Simon.

The skinny Frenchman said he was relaxed on a hot, humid, sunny day in Louis Armstrong Stadium, noting that Ferrer had dominated their previous matchups 5-1 and not many of them were close.

“He destroyed me every time, so I felt I had nothing to lose,” Simon said. “I just wanted to go out and enjoy myself on the court.”

Going into Sunday, none of the top 10 men’s seeds had lost. For Ferrer, it marks his second straight early exit from a Grand Slam tournament after a second-round loss to Andrey Kuznetsov at Wimbledon. That ended Ferrer’s streak of 10 straight major tournament quarterfinals.

Simon moves on to play the winner of the match between 14th-seeded Marin Cilic and 18th-seeded Kevin Anderson.

Earlier, 13th-seeded Sara Errani used steady shots and her soft serve to reach the quarterfinals, beating 32-year-old qualifier Mirjana Lucic-Baroni 6-3, 2-6, 6-0 to end the tournament’s most unlikely comeback story.

Errani, the 2012 French Open runner-up, was content to play counterpuncher to the big-hitting Lucic-Baroni, who racked up 69 unforced errors. Errani made nearly 90 percent of her first serves, which averaged a mere 76 mph, and dared her big-hitting opponent to over hit. Which she did.

“I just have to try to make her make mistakes. This is my game against her,” said Errani, an Italian scrambler who looks shorter than her listed 5-foot-4. “The important thing for me was to try to move her, try to be more consistent again, and try to be aggressive.”

The 121st-ranked Lucic-Baroni, who upset second-seeded Simona Halep in the third round, is a former teen prodigy who last made a deep run in a Grand Slam tournament in 1999, when she reached the semifinals of Wimbledon. But family issues, money woes and injuries sidetracked her career, and she didn’t make the draw of any major tournament for nearly eight years until 2010.

“This has been a great two weeks, the best so far since I can remember for a long time,” she said. “Today I felt like I ran out of gas a little bit.”

Errani next plays Wozniacki.

Only subscribers are eligible to post comments. Please subscribe or to participate in the conversation. Here’s why.

Use the form below to reset your password. When you've submitted your account email, we will send an email with a reset code.