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

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

So he and the Razorbacks were breathing a sigh of relief after surviving it.

"We certainly are glad to have the win," Anderson said. "It wasn’t a thing of beauty."

Arkansas grinded its way to a 71-64 win against the Gamecocks in front of an announced crowd of 9,548 in Bud Walton Arena. The Razorbacks had to fight through a rugged night 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 commanding 17-point lead in the first half, then had to fight throughout the second half after squandering it. Arkansas eventually did just enough down the stretch to hold on.

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 about South Carolina. "A well-coached team. We expected that. We knew they weren’t going to go away easy."

Qualls made one of the game’s biggest plays when he knocked down a 3-pointer with 4:40 left, breaking 55-55 tie. 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 critical response when guard Mardracus Wade knocked down another 3-pointer to push the lead back to five points. Once again, South Carolina battled to cut Arkansas’ lead back to two at 66-64.

The Razorbacks wouldn’t let the Gamecocks get any closer, though, learning on their defense to get key stops in the final minute. Arkansas also made enough free throws in the final seconds to survive at home.

"It’s easy to come and be relaxed," Qualls said about facing South Carolina after the LSU win. "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."

Arkansas may have expected a tough test, but the close call wasn’t what they imagined after a 20-2 run late in the first half. Qualls, Wade and Fred Gulley all made 3-pointers during the stretch, which helped the Hogs take a 40-23 lead.

But 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 late in the first half with a 3-pointer. 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 over 3:20 trimmed Arkansas’ lead to 40-38.

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

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

Said Qualls: We didn’t find the shooter. 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."

Forward Bobby Portis (9 points, 5 rebounds, 5 blocks) 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 Qualls’ putback dunk off a missed shot.

Portis stole the ball in the paint on the next possession, then led a fastbreak that ended with Ky 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, although it didn’t mean things went smoothly the rest of the way.

The Razorbacks struggled largely because of 17 turnovers. Arkansas also shot just 67.9 percent (19-for-28) from the free-throw line. Arkansas went 22-for-58 (37.9 percent) from the field, but was just 8-for-32 (25 percent) in the second half.

"The shooting went down in the second half," Anderson said. "I guess that’s an understatement. We got cold and couldn’t hit any shots."

South Carolina wasn’t much better outside of Williams. The Gamecocks finished shooting 37.3 percent and committed 19 turnovers.

Guard Sindarius Thornwell, who was the team’s leading scorer in SEC play, was held to 8 points on 2-for-12 shooting. He also committed a team-high six turnovers.

Martin credited his team for battling back, but said South Carolina’s struggles in the first half were too much to overcome.

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

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

It was vital on a night Madden, Arkansas’ most consistent playmaker, struggled.

The senior, 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 SEC games.

Qualls, meanwhile, fell one point shot of his career high. His 3-pointer — which helped Arkansas take the lead after the game was tied at 55-55 — was his fourth. He finished 7-for-14 from the field and also added 8 rebounds Wednesday.

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