PARIS (AP)—Barely able to walk—let alone run—as the fifth set dragged on, Fabio Fognini figured there was no way he’d be able to pull out a victory Sunday at the French Open.

“Of course,” he said, “I should have lost this match.”

Somehow, though, he won. Italy’s Fognini overcame a left thigh injury and five match points to outlast Spain’s Albert Montanes 4-6, 6-4, 3-6, 6-3, 11-9 at Roland Garros, reaching his first Grand Slam quarterfinal.

The scoreline pretty much says it all, but here’s one other indication of close it was: Fognini won 189 points, Montanes 188.

The match lasted 4 hours, 22 minutes, with the temperature in the 70s, and by the end, the 49th-ranked Fognini essentially would stand in place on court, immobile, yet would win exchanges with a winner or when Montanes would make an unforced error.

“I have to be honest. I didn’t think I could win the match,” Fognini said. “I couldn’t move. I couldn’t serve.”

He explained that his only choice was to swing away at the ball, “and if it went in, it went in.”

While trailing 7-6 and serving at 15-30—meaning Montanes was two points from victory—Fognini winced in pain at the baseline after hitting a serve and clutched at his left leg. He called for the trainer and sat down in his changeover chair for a massage while play was halted. When action resumed, Fognini won three points in a row to hold serve for 7-all.

Fognini got other visits from the trainer, eventually having a bandage wrapped around his troublesome thigh. He originally thought he was cramping, but later said he might have pulled a muscle.

Asked by a reporter whether Fognini might have been faking the injury, Montanes replied through a translator: “I can’t say if he was pretending, if he was really hurt or not.”

The 38th-ranked Montanes was broken while serving for the match at 5-3 in the fifth, and he later failed to convert match points on Fognini’s serve at 8-7 and at 9-8.

Fognini broke Montanes to lead 10-9, then served out the victory, closing it with a backhand winner.

On point after point, Montanes would hit the ball right near Fognini, rather than forcing the Italian to move around more to get to shots.

“He was hitting so hard I didn’t want to take too many risks,” Montanes said. “It’s always easy to say, ‘You could have done that. You should have done this. You should have seized more opportunities and been more aggressive on these points.”’

Fognini’s take on the way his opponent played down the stretch: “It’s not easy when you see someone across the net who can’t move.”

The 24-year-old Fognini is Italy’s first man in the French Open quarterfinals since 1995, and first to make it this far at any major tournament since 1998.

Right after Sunday’s match, he wasn’t sure how badly he was injured and whether it could prevent him from playing against No. 2 Novak Djokovic in the quarterfinals. Djokovic has won 43 consecutive matches.

“I would love to play the next match, because this is a little dream I’ve got going here,” Fognini said. “Even if I’m only at 50 percent, I want to play.”

Montanes was trying to reach the first Grand Slam quarterfinal of his career at age 30, and he’d won his last six matches that went five sets. All five of his career titles have come on clay, the surface used at Roland Garros.

“Life will continue,” Montanes said. “A match is lost, but life continues.”