NASHVILLE, Tenn. -- Ninth-ranked South Carolina and coach Steve Spurrier got a big scare to open the season. Marcus Lattimore and Connor Shaw helped the Gamecocks grind their way through past scrappy Vanderbilt.

Lattimore ran for two touchdowns and 110 yards in his first game back after tearing his left ACL, and Shaw ran for 92 yards while playing the second half with an injured shoulder as South Carolina rallied for a 17-13 victory against Vanderbilt on Thursday night.

"Maybe it's good for us ...," Spurrier said. "You look at the preseason press, we thought we were hot stuff. Then we almost got that stuff beat out of us."

This is the highest ranking South Carolina ever has started a season, and the Gamecocks are expected to challenge for an SEC East title after going 11-2 last season.

But Shaw bruised his right, throwing shoulder late in the first half and missed the first two series of the third quarter before returning. The junior drove the Gamecocks for the go-ahead touchdown and ran 12 yards to the Vandy 1 before rolling in pain in the end zone.

Lattimore scored the go-ahead TD on a 1-yard run with 11:25 to go.

"They gave me some medicine," Shaw said. "I got a ball and just started working out, I didn't want it to get stiff on me. It was painful, but I got through it."

Spurrier called Shaw's performance gutsy after taking a helmet to the shoulder blade that left his throwing shoulder bruised but not dislocated. Spurrier said Shaw even assured him he could pick up a first down inside the final minute to make sure the Gamecocks ran out the clock to seal the win.

"He'll be sore for a while. I think he should be OK. Had some nice runs there. He was hurting a little bit. That's what it took," Spurrier said.

Vanderbilt had plenty of time to attempt a comeback, the last with 5:08 left. But the Commodores turned it over on downs with 1:47 to go when Jordan Matthews couldn't handle a fourth-down pass from Jordan Rodgers. Gamecocks defensive back D.J. Swearinger appeared to grab Matthews' arm before the ball arrived.