WACO, Texas — South Carolina guard Sindarius Thornwell got off two desperate shots while trying to score a tying basket in the final 4 seconds at No. 23 Baylor.

Michael Carrera then grabbed a rebound and went back up, drawing contact – and a whistle – at the same time the buzzer sounded.

After a lengthy video review, officials determined that the game was over, and Baylor had a 66-64 victory over the Gamecocks on Tuesday.

“They say the contact took place when the red light was on,” South Carolina coach Frank Martin said. “Those guys did a great job. I haven't seen the play, but those guys manage games.”

Even without the extra foul that would have sent Carrera to the line with a chance to force overtime – he was 6 of 6 on free throws in the game – the game was plagued by 55 fouls. There were only 37 total field goals, none in the final 4 minutes.

The Gamecocks (1-1) didn't score again after Thornwell, who finished with 20 points, penetrated around 7-foot-1 Isaiah Austin for a short floater with 4:20 left. That tied the game at 64.

“I'm proud of my guys. Their resolve. The desire to go out there and believe in what we've been doing for ourselves in a place where it's hard for opposing teams,” Martin said. “Our resolve is good. We didn't rebound it the way we needed to. Back-to-back free throw misses in the second half that led to Brady Heslip 3s. That went from us having a lead to us being down. It's unfortunate. It's 30 games, not two games. I like where we're at.”

Thornwell is one of seven freshmen for South Carolina, and Carrera is among five sophomores on the 15-man roster.

Heslip scored 18 points with five 3-pointers for Baylor (2-0), which held on without making a field goal in the final 7 minutes.

While Baylor shot only 54 percent from the free throw line (22 of 43), the difference was free throws by Royce O'Neale with 2:02 left and by Kenny Chery with 20 seconds left that set up that crazy final segment.

“The good thing is free throw shooting is the one area that tends to get better throughout the season and the one thing we've practiced more this year,” Baylor coach Scott Drew said. “Free throws are the most mental thing in the game. It's like someone gets a cold in your house. It spreads.”

South Carolina had a chance to take the lead with 2:27 left when Tyrone Johnson had a steal and breakaway, but he missed the layup.

“Just no excuse. I missed the layup. I could say that I was running too fast, this and that, but there's just no excuse,” said Johnson, who finished 1-of-7 shooting for eight points with eight assists. “As the point guard, as the leader, I've just got to come through and make the layup.”

O'Neale's free throw finally broke the 64-all tie. South Carolina then had a shot-clock violation, when Brenton Williams had to throw up a long shot and missed the rim after the ball had been knocked out of bounds with 4 seconds left on the shot clock.

Carrera blocked a shot by Cory Jefferson before Johnson missed another layup chance with 42 seconds left when Austin got a block.

Austin had 14 points for Baylor and Taurean Prince had eight points and 12 rebounds.

Early on, both teams seemingly couldn't miss from the field. Baylor made its first six shots and the Gamecocks were 8 of 9 before missing consecutive shots, including a putback chance before a foul, less than 8 minutes into the game.

But with all the whistles that followed, neither team could get into much of a rhythm after that. Baylor finished shooting 39 percent from the field (19 of 49) and South Carolina was at 36 percent (18 of 50).

“ I think coaches have really tried to do a good job keeping hands off. I think we'll get better at coaching what are going to be called fouls, and I think officials will get better at calling what things are going to be called,” Drew said. “So I think probably the next month both of us will make improvements and keep getting better.”