The UCF football team’s hyped-up, sold-out, stadium-rattling, fourth-largest-crowd-in-school-history-witnessing matchup against South Carolina started out promising enough.

UCF went in swinging against the No. 12 team in the country and headed into halftime boasting a 10-0 lead. Trailing 28-10 in the fourth quarter, the Knights (3-1) made it a game with clutch plays in the closing minutes after many had written them off.

Alas, four ill-timed turnovers did in the Knights, who suffered their first loss of the season, 28-25, Saturday afternoon at Bright House Networks Stadium.

“There’s no quit in us,” UCF head coach George O’Leary said. “I knew they would never quit. They wouldn’t be in the program if that’s the kind of kids they were. Tough game, tough loss. I think we played with great effort but not smart effort all of the time. We didn’t make enough plays.”

UCF made the most of its opening possession, thanks to some big-time plays from quarterback Blake Bortles, who had a career-high 358 yards through the air, and running back Storm Johnson.

As the Knights marched into Gamecocks territory, Bortles connected with Johnson on third and 10 to pick up 20 yards. Bortles gained another 19 on the ground, falling one yard short of the end zone. Johnson carried it in the rest of the way to give UCF a 7-0 lead after a 10-play, 75-yard drive.

The defense came through on South Carolina’s possession as Terrance Plummer wrapped around quarterback Connor Shaw to force a fumble at midfield allowing Brandon Alexander to recover it for the Knights. The play resulted in more implications for South Carolina as Shaw sprained his right shoulder, forcing him to sit out the rest of the game.

“When I hit him, I didn’t even know I got the ball out,” Plummer said. “I just tried to make a play on the ball and try to get the ball back to the offense, who was rolling at that point in time.”

UCF capitalized again late in the second half after Jeff Godfrey came through with back-to-back momentum-swinging plays. He churned out an 18-yard reception on 3rd-and-7 before drawing a penalty from South Carolina safety Brison Williams that resulted in 15 more yards in UCF’s favor.

The Knights turned the drive into a 27-yard Shawn Moffitt field goal to take a 10-0 edge. It marked the first time since Jan. 2, 2010, that the Gamecocks (3-1) were held scoreless in the first half.

Things changed quickly in the second half. It took all of 69 seconds for the Gamecocks to get into the end zone after the break as Mike Davis rattled off a 53-yard touchdown run to inch closer, 10-7. It seemed to awaken the South Carolina offense, which began to find its rhythm with the run game.

When quarterback Dylan Thompson capped a season-long 97-yard drive with a short 2-yard rush for another touchdown to up the score, 14-10, with 3:58 remaining in the third, it signaled the first time that UCF trailed an opponent all year.

UCF attempted to regain some of its first-half magic on its next drive with a double-pass play that put the ball in the hands of former QB Godfrey. He sent the ball diagonally across field to his intended target, Johnson, but South Carolina’s Jimmy Legree stole it out of the sky and returned it 21 yards into Knights territory.

The interception jump-started the Gamecocks’ drive to a third-unanswered touchdown, punched in by Mike Davis’ 13-yard rush with 14:02 remaining.

UCF saw its next possession end with its first lost fumble in 2013, leading to one more South Carolina touchdown – another Davis 13-yard rush for a 28-10 advantage.

The Knights finally responded with a bang-bang sequence lasting 39 seconds as Bortles found Rannell Hall for a 73-yard touchdown reception. Receiver J.J. Worton was quick on his feet in the back of the end zone to come through with a 2-point conversion before being pushed out of bounds, pulling the Knights within 10 points, 28-18 with just less than 10 minutes left.

UCF’s defense came up with a huge stop on 3rd-and-13 courtesy of a Thomas Niles sack. Worton produced a 35-yard punt return that put the Knights into South Carolina territory.

Things seemed to be going UCF’s way until Bortles was intercepted by T.J. Holloman with 6:48 remaining to hold off the Knights’ comeback for a little longer.

The Gamecocks made it down to UCF’s 3-yard-line, threatening to put the game out of reach, but Michael Easton forced Davis to fumble, allowing Deion Green to pick it up and give the Knights the ball with 3:18 remaining.

UCF sophomore wide receiver Breshad Perriman exploded for a 79-yard reception, setting up Bortles to connect with Hall for a 7-yard touchdown and close the gap to 28-25, with two minutes remaining.

The on-side kick did not go in UCF’s favor. The Knights did not have a time out remaining, allowing the Gamecocks to run out the clock and escape Orlando with the win.

“It’s going to be hard to let it go after 24 hours but that’s what you have to do,” Bortles said. “You live and you learn. You learn from your mistakes and try not to make the same ones twice. The good thing about this is, we start conference play next week so we’ve got to get ready for Memphis.”

UCF travels to Memphis on Oct. 6 for a 4:30 p.m. ET kickoff, set to air on ESPN3.