LONDON — Seven-time Wimbledon champion Roger Federer was stunned by Sergiy Stakhovsky in the second round at the All England Club on Wednesday, his earliest loss in a Grand Slam tournament in 10 years.

The 27-year-old Ukrainian, a 116th-ranked qualifier, outplayed Federer, serving and volleying his way to a 6-7 (5-7), 7-6 (7-5), 7-5, 7-6 (7-5) victory that stands out as one of the sport’s biggest upsets.

‘‘Magic,’’ Stakhovsky said. ‘‘I couldn’t play any better today.’’

Federer’s loss ended his record streak of reaching at least the quarterfinals at 36 consecutive Grand Slam tournaments, a run that began at Wimbledon in 2004, shortly after a third-round exit at that year’s French Open. Full story for BostonGlobe.com subscribers.

Get the full story with unlimited access to BostonGlobe.com. Just 99¢ for 4 weeks.
Get Access Now