HALLE, Germany—Rafael Nadal was knocked out in the second round of the grass-court Gerry Weber Open on Thursday, losing 6-4, 6-1 to German wild card Dustin Brown.

The world No. 85 broke Nadal's serve at the fifth attempt to win the first set, and he pulled off two audacious lobs in succession to break the Spaniard again early in the second.

Nothing Nadal tried seemed to work in his first match since winning his ninth French Open title. He had a first-round bye at Halle.

Brown raced ahead to win in just under an hour, and will next face compatriot Philipp Kohlschreiber in the quarterfinals.

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 earlier.

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 important to stay calm, and actually it gives me more confidence winning this way than maybe just 6-4, 6-4, and you don't quite know what is going on," said Federer, who acknowledged he was worried after losing the first set.

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

"The first day when I came here to practice it was bit so-so, and everyday after that was very good," Federer said.

He will next play Taiwan's Yen-Hsun Lu, who defeated Croatia's Ivo Karlovic 7-6 (2), 7-6 (3).

"I will have to adjust in the sense that there will be more baseline duels," said Federer, who was also playing a doubles match later. "We'll see. But I think it's positive that I spent more time on the court today."