CHAPEL HILL, N.C. (AP) -- Steve Spurrier won again at North Carolina, but this time he wasn't in the mood to snap any photos of the scoreboard.
After Chris Smelley threw a career-high three touchdowns in the first half, the No. 7 Gamecocks nearly blew an 18-point halftime lead before escaping with a 21-15 victory over the Tar Heels on Saturday.
The redshirt freshman improved to 4-0 as a starter by helping the Gamecocks (6-1) successfully defend their first top 10 ranking since 2001.
But Spurrier clearly wasn't happy with his team's second-half performance, taking responsibility for what he said was a "putrid offense" that gained 62 yards after the break, rushed more than twice as often as it passed and saw an easy victory come down to the final play.
"We were playing well, up 21-3, and we tried to run and call that conservative crap, and then we couldn't throw it later," Spurrier said.
The Tar Heels (2-5) made things interesting late. T.J. Yates threw an 18-yard touchdown pass to Greg Little on the first play of the fourth quarter, then ran 3 yards for another score to make it a six-point game with 3:03 remaining.
The Gamecocks gave North Carolina one last chance, after Ryan Succop's 48-yard field goal bounced harmlessly off the right upright with 46 seconds left.
Yates threw three quick completions to move the Tar Heels to the South Carolina 31, but misfired on his last two throws toward the end zone, with his final pass deflected away by a pair of the Gamecocks' offensive players -- wideout Kenny McKinley swatted it at about the 1 and tight end Jared Cook smacked it to the ground.
Yates finished 22-of-42 for 285 yards against the nation's best pass defense, and Hakeem Nicks had eight receptions for 114 yards for the Tar Heels, who in Butch Davis' first season has lost four games by seven or fewer points.
"Every single one of these games is just so close, and it hurts more and more. You get closer and closer against better teams, but there's little things that we've got to do to get us over the hump," Yates said.
North Carolina had 398 total yards to South Carolina's 282, had nearly a 10-minute advantage in time of possession and stopped the Gamecocks on 12 of 13 third-down chances. But the Tar Heels couldn't overcome three interceptions -- one thrown on a trick play in the fourth by quarterback-turned-receiver Joe Dailey in the red zone -- plus a missed field goal, a botched extra point and a failed two-point conversion.
"We missed so many opportunities during the course of this game," Davis said. "To beat a good football team, you have to hit on some of those opportunities."
Smelley completed 17 of 26 passes for 172 yards with scoring passes to three different receivers, covering 3 yards to Dion Lecorn, 30 yards to McKinley and 12 yards to Jared Cook.
"Every time I get on the field and have some experience, it definitely helps me progress as a quarterback," Smelley said.
Cory Boyd rushed 20 times for 95 yards for South Carolina, helping Spurrier remain unbeaten in four games against the Tar Heels. His previous three wins came when he was at Duke from 1987-89, and his most recent visit to Kenan Stadium -- a 41-0 rout -- was memorialized with a team photo by the scoreboard, a snapshot that still hangs in his office.
"It felt like I was coaching for the Dukies and the South Carolina people," Spurrier quipped.
The Gamecocks clicked early in jumping out to a 14-0 first-quarter lead. They scored on two straight possessions, with Smelley's 20-yard pass to Cook setting up his 3-yard strike to Lecorn.
Then, Smelley and Cook hooked up again for 23 yards one play before he found McKinley behind cornerback Jermaine Strong, and the receiver spun toward the right sideline and pulled down his team-leading sixth touchdown of the season.
South Carolina made it 21-3 at halftime when Captain Munnerlyn's 38-yard punt return in the final minutes of the half set up Smelley's scoring pass to Cook with 15 seconds left.
North Carolina's Connor Barth missed a field goal for the first time since 2005 when he pulled a 49-yard attempt wide left in the first quarter, snapping a streak of 19 straight conversions. He made a 45-yarder on his next try early in the second.
"North Carolina didn't play well in the first half. They had a lot of stumble, bumble plays and gave us the chance to get a lead," Spurrier said.