SAN FRANCISCO (AP) Somehow, Lance Lynn stayed on his feet long enough to finally beat the San Francisco Giants.
Once, he caught his spikes and nearly topped down the dugout steps. Twice, his right knee buckled. And in the most scary scene of all, the St. Louis pitcher twisted his right ankle making a play and was forced to leave Saturday.
Lynn still wound up with his first career win over the Giants, sending the NL Central-leading Cardinals to a 6-0 victory.
Later in the clubhouse, Lynn pulled his tried-and-true cowboy boots over the tender ankle and vowed to take his next turn in the rotation.
''As long as I can get up and walk, I'll be able to pitch next time out, so I'm not worried about it,'' he said.
Lynn (11-8) pitched neatly into the eighth inning before leaving with a mild ankle sprain that's not considered serious.
''Maybe I should file my cleats down a little more,'' he quipped.
It sure had manager Mike Matheny worried.
Lynn awkwardly came off the mound to field Juan Perez's leadoff chopper in the eighth and twisted his ankle trying to throw to first. That was Lynn's final batter, and he'll be reevaluated Sunday.
''Just sick when you see him go down like that because he's a tough guy. He has a high pain tolerance,'' Matheny said. ''I never thought he was going to be walking off the field. That was huge.:
''He's in there joking around about his non-athleticism right now. Good to hear. We don't know what that means except it's not a lot of the worst-case scenarios that were going through our minds,'' he said.
Lynn gave up six hits, struck out two and walked two. He had been 0-4 with a 6.33 ERA in his previous four regular-season starts against San Francisco and 0-1 in three postseason outings.
The right-hander outpitched Ryan Vogelsong (9-10) after losing to him 2-0 on Aug. 18 at Busch Stadium.
The Cardinals broke open a scoreless game with four runs in the fifth.
''The big inning killed us there. We couldn't stop them,'' Giants manager Bruce Bochy said.
Brandon Moss led off with a triple and Matt Carpenter singled with one out. A single by Stephen Piscotty and a walk to Jason Heyward loaded the bases.
Reliever George Kontos' second pitch was wild, allowing another run to score. Yadier Molina followed with a two-run single.
Piscotty later had an RBI triple, a day after the Cardinals' five-game winning streak was stopped by the Giants.
San Francisco began the day 2 1/2 games back of first-place Los Angeles in the NL West.
Vogelsong, who twice beat the Cardinals during the Giants' 2012 postseason run to the World Series championship, failed to reach five innings for the second straight start. He allowed four runs on seven hits and three walks in 4 2-3 innings.
The right-hander had been 2-0 with a 2.70 ERA over his previous three starts at AT&T Park. His defense gave him inning-ending double plays in the first and third before he ran into trouble in the fifth.
''Everybody knows we're banged up, but I'll take the ball with whoever is behind me,'' Vogelsong said.
Cardinals reliever Sam Tuivailala, recalled from Triple-A Memphis on Friday, struck out three in the ninth and allowed two runners.
Cardinals: OF Matt Holliday, sidelined since July 30 with a strained right quadriceps muscle, was reevaluated in St. Louis. ... Reliever Jordan Walden, out since April 29 with a strained right biceps, also has been seen again by team doctors. ... Closer Trevor Rosenthal, put on the paternity leave list Friday, is set to rejoin the team Monday at home against Washington. He and his wife welcomed a baby girl Friday night.
Giants: C Buster Posey rested after being hit by a pitch in the left elbow Friday. ... 2B Joe Panik, out since Aug. 2 with low back inflammation, did some running and hit in the indoor cage. He will take live BP on the field Sunday and is set to begin a rehab assignment Tuesday with Triple-A Sacramento. ''It's been a little while,'' he said. ''It's nice to be wearing baseball pants again.''
Cardinals: LHP Jaime Garcia (6-4) tries to win his fourth straight decision and complete an unbeaten August. He is 9-3 with a 1.64 ERA over his last 14 road starts dating to Sept. 15, 2012.
Giants: RHP Chris Heston (11-7) makes his first start since Aug. 17 at St. Louis and is 0-2 over his last four starts, going fewer than five innings in three of those. He was given an extended break in the minors.