WIMBLEDON, England — Six-time champion Roger Federer was upset in the Wimbledon quarterfinals for the second straight year Wednesday, squandering a two-set lead for the first time at a Grand Slam tournament and losing to Jo-Wilfried Tsonga 3-6, 6-7 (3), 6-4, 6-4, 6-4.

Federer barely looked challenged while winning the first two sets against the 12th-seeded Frenchman. But the Swiss star, who had been 178-0 in matches in which he had won the opening two sets at a major tournament, was broken one time in each of the last three sets.

“It’s kind of hard going out of the tournament that way, but unfortunately it does happen sometimes,” said Federer, who was playing in his 29th straight major quarterfinal. “At least it took him sort of a special performance to beat me, which is somewhat nice.”

Federer may be right. The 16-time Grand Slam champion finished the match with only 11 unforced errors, half as many as Tsonga, but it didn’t help him get close to breaking Tsonga’s serve when he needed it.

“I was two sets down and I break. I did a good game of return and after that it was just amazing,” said Tsonga, who had 63 winners, five more than Federer. “I just played unbelievable, served unbelievable and now I’m here, I’m in semifinal and I can’t believe it.”

Federer was seeking to equal Pete Sampras’ record of seven Wimbledon singles titles. He breezed through his opening four matches, losing only one set, and played his usual elegant game against Tsonga.

In the first set, Federer earned his one and only break point of the match in Tsonga’s first service game, and converted it. He held the rest of the way, and then won the second set in the tiebreaker.

But Tsonga finally got his first break in the third set, and another in the fourth and another in the fifth.

“He can come up with some good stuff and some poor things at times,” Federer said. “He had basically good return games along the way in the third, fourth, and fifth. I think especially the third set, the break I get is very unusual. He chips back a couple, they stay in.”

Those were the Frenchman’s only three breaks, and they were just enough to send Federer home early again.

Last year, he lost to eventual runner-up Tomas Berdych in the quarterfinals.

“It’s the biggest champion in my sport,” Tsonga said. “He achieved a lot of things and he’s just the best player in the world and I’m just so happy to win against him, especially on grass because it’s maybe one of his favorite surface and I’m just so happy today.”

Instead of Federer improving on his record haul of major titles, 10-time Grand Slam champion Nadal can add to his own.

The top-seeded Spaniard lost one set but did not appear to be bothered by the left foot he injured in his previous match against Juan Martin del Potro.

“Today it was better. The treatment worked and I’m fine. I’m here,” Nadal said. “The previous match was tough for me because for a moment I didn’t know if I had a serious injury, but since (it’s) nothing important (it’s) probably going to work.”

On Court 1, Djokovic overcame a tough match against his protege, holding on to reach the semifinals for the third time in his career.

Djokovic has been practicing with Tomic on-and-off since the two became friends last year in Australia, but this was the first meeting between the two in a competitive match.

After Tomic put a forehand into the net on match point, the pair had a brief chat at the net. Then, with the crowd applauding, Djokovic did the same while motioning toward Tomic.

“It was a very even match. In the first set I felt I played quite well,” said Djokovic, who finished the match with fewer winners than Tomic, 43-39. “Then I played one really bad service game and he got back into the match. And from that moment on, he was the better player.”

At the start, Djokovic appeared to have little to worry about, rolling through the first set and on his way to a fifth straight major semifinal. But Tomic didn’t quit, instead breaking Djokovic to take a 3-1 lead in the second set and eventually evening the match.

“He is such an unpredictable player. He’s very young, and obviously, first quarterfinals of a Grand Slam for him means a lot,” Djokovic said. “But he didn’t have anything to lose, so he was hitting a lot of winners today.”

Tomic again went up a break in the third, but that’s when Djokovic got going. The two-time Grand Slam champion won five straight games to take the third set, and then won the first two games in the fourth. Although Tomic got back on serve at 2-2 and was two points from winning the set at 5-4, Djokovic soon broke to take a 6-5 lead and held for victory.

“It was really hard to predict where he’s going to go. He was not making a lot of unforced errors from the baseline, and that made my life really difficult,” Djokovic said. “I tried to change the pace, but he was better at that. We were playing cat and mouse, I think. But in the end, I’m just happy to get through.”

Djokovic started the 2011 season by winning 41 straight matches, but that came to an end with a loss to Federer in the French Open semifinals. If the Serb reaches the final at the All England Club for the first time this year, he will guarantee himself the No. 1 ranking. He can also claim the top ranking if Nadal fails to defend his title.

Tomic was the youngest man to start in the men’s draw this year, and is the youngest to reach the Wimbledon quarterfinals since Boris Becker defended his title in 1986.

Murray is trying to become the first British man to win the Wimbledon title since Fred Perry in 1936. And against Lopez, he was never really bothered.

He saved the two break points he faced, both in the third set, and finished off the match by winning the final game at love.

“I’ve played a little bit better every year I’ve come here,” said Murray, who is in the semifinals for the third straight year. “I want to go further.”