FAYETTEVILLE — Arkansas coach Mike Anderson believed his team was in for a rugged night against a must-win game against South Carolina on Wednesday.

FAYETTEVILLE — Arkansas coach Mike Anderson believed his team was in for a rugged night against a must-win game against South Carolina on Wednesday.

He and the Razorbacks were breathing a sigh of relief after narrowly surviving it.

Arkansas grinded its way to a 71-64 victory against the Gamecocks in front of an announced crowd of 9,548 in Bud Walton Arena. Guard Michael Qualls scored a team-high 20 points to lead the Razorbacks (17-9, 6-7 in Southeastern Conference), who won for the fourth time in five games to keep their postseason hopes alive.

"They’re a tough team," Arkansas forward Coty Clarke said. "A well-coached team. We expected that. We knew they weren’t going to go away easy."

Nothing was easy against South Carolina (10-16, 3-10), which had been 1-18 on the road under second-year coach Frank Martin. The Razorbacks struggled early, buckled down to build a 17-point lead in the first half, but had to fight throughout the second half. Arkansas eventually did just enough down the stretch to hold on.

"They gave it a great shot," Anderson said. "But we were able to overcome and make some plays. It’s important this time of the year. Every win is a big win."

Qualls hit one of the game’s biggest plays when he broke a 55-55 tie with 4:40 left to give the Razorbacks the lead. It was the start of a 7-0 run that helped Arkansas regain a comfortable advantage. But the scrappy Gamecocks wouldn’t go away.

South Carolina scored the next five points to cut the deficit to 62-60.

Arkansas turned in another key response when guard Mardracus Wade knocked down a three-pointer to push the lead back to five points. Once again, South Carolina battled to cut Arkansas’ lead back to two points at 66-64.

The Razorbacks wouldn’t let them get any closer, though, turning to their defense to get key stops. Arkansas then made enough free throws to survive at home.

"It’s easy to come and be relaxed," Qualls said. "A team like that, they have nothing to lose. They have everything to gain. They have no pressure. So they just come in and play ball. That’s what they did."

It wasn’t the close call Arkansas imagined, though, when the Razorbacks used a 20-2 run late in the first half to build a 17-point lead Wednesday.

Arkansas watched its big advantage crumble in a matter of minutes behind South Carolina guard Brenton Williams, who scored a game-high 29 points.

Williams helped begin South Carolina’s spurt began late in the first half. The Gamecocks scored six straight to cut Arkansas’ deficit to 40-29 at the break. It continued in the second half, when South Carolina scored nine straight.

The 15-0 run trimmed Arkansas’ lead to 40-38.

Williams — who was South Carolina’s top three-point shooter — went 6-for-13 behind the line. He struggled early, missing his first three attempts, but heated up quickly.

"We didn’t find the shooter," Qualls said. "He was shooting the ball well and we weren’t finding him. He was big for them. A team always needs a player to step up when the team isn’t doing good and he was that player."

Said Williams: "I was just trying to be aggressive. I kept my head on as strong as I could and picked it up in the second half."

Forward Bobby Portis helped Arkansas snap out of the slump with two big defensive plays. After turning the ball over on one end, Portis hustled down the floor to block a shot that helped Arkansas preserve its lead. It led to Qualls’ putback dunk.

Portis stole the ball in the paint on the next possession, then led a fastbreak that ended with Madden going to the free-throw line. Arkansas was able to regain a 47-40 lead because of the sequence. The Razorbacks never lost the lead in the second half, but it didn’t mean things went smoothly the rest of the way.

Arkansas shot 25 percent (8-for-32) in the second half and finished at 37.9 percent (22-for-58). The Razorbacks also committed 17 turnovers and shot just 67.9 percent (19-for-28) from the free-throw line.

South Carolina shot 37.3 percent and committed 19 turnovers against Arkansas’ aggressive defense. Guard Sindarius Thornwell, who was the team’s leading scorer in SEC play, was held to 8 points on 2-for-12 shooting.

"I was disappointed with the last minute and a half when we were up 21-20 and it went to 40-23," said South Carolina coach Frank Martin, whose team had won two straight after a 1-9 SEC start. "That’s when the game got away from us."

Qualls was a big part of that run. He proved critical down the stretch, too.

It was much needed on a night leading scorer Ky Madden struggled.

Madden, who was leading the team in scoring in SEC play, finished with just 3 points on 0-for-8 shooting. It was his lowest-scoring performance in conference games.

Qualls, meanwhile, fell one point shot of his career high. His three-pointer — which helped Arkansas take the lead after the game was tied — was his fourth of the night.

"Somebody has to step up and that’s the beauty of this team here," Anderson said.