HALLE, GERMANY - JUNE 12: Roger Federer of Switzerland celebrates after winning his match against Joao Sousa of Portugal during day four of the Gerry Weber Open at Gerry Weber Stadium on June 12, 2014 in Halle, Germany. (Photo by Thomas Starke/Bongarts/Getty Images)

Halle, Germany - Roger Federer began his grass-court preparations for Wimbledon by coming from behind to beat Joao Sousa of Portugal 6-7 (8), 6-4, 6-2 at the Gerry Weber Open on Thursday.

Sousa saved all five break points he faced before taking the first set in a tiebreaker, but the second-seeded Federer raised his level in the next two sets to win the second-round match and move into the quarterfinals.

It was Federer's first match since losing in the fourth round at the French Open to Ernests Gulbis. He had a first-round bye in Halle, where he is a six-time champion.

The seven-time Wimbledon winner will next play Croatia's Ivo Karlovic or Taiwan's Lu Yen-hsun.

Top-seeded Rafael Nadal was scheduled to play Dustin Brown later on Thursday in his first match since winning his ninth French Open title.