It was at turns clunky and hard to watch, but it was entirely sweet.

Georgia Tech played perhaps its most memorable game in the young history of McCamish Pavilion, rallying from 12 points down with less than seven minutes to go and four down with just over a minute left to claim a 67-64 win over Illinois on Tuesday night.

Both for the manner of victory and quality of opponent, it ranks among coach Brian Gregory’s most significant wins in his three-year tenure. The Illini (7-1) were an NCAA tournament team last year, were undefeated before Tuesday and came into the game ranked No. 18 in RPI.

The win also ended Tech’s five-game losing streak in the Big Ten/ACC Challenge, a streak that included a 75-62 road loss to the same Illini in November 2012.

“Just proud of our guys,” coach Brian Gregory said. “That’s the way, when I think of Georgia Tech in terms of how I want our team to play, that’s the way I envision it, that type of toughness, that type of energy, intensity.”

Tech’s sophomore duo of Robert Carter and Marcus Georges-Hunt led the charge in the closing minutes. Tech (6-3) trailed 60-48 at the seven-minute mark before Georges-Hunt tossed in a 3-pointer with 6:22 to play. It spurred a 19-4 closing run. Carter and Georges-Hunt scored 14 of the 19. Carter made a big 3-pointer to cut the lead to 64-63 with 1:01 remaining. Center Daniel Miller scored the go-ahead basket with 24 seconds remaining, putting Tech up 65-64. Carter then came through again, first rebounding Joseph Bertrand’s missed 3-pointer with six seconds left and finally making both free throws to put Tech up three with three seconds to go.

“We didn’t put our heads down,” said Georges-Hunt, who finished with 20 points and three assists and gave superior defensive effort. “We kept telling each other, ‘Keep fighting, keep fighting, never let up.’”

Tech entered the game on a two-game losing streak, having lost to Ole Miss and St. John’s at the Barclays Center Classic in New York over Thanksgiving weekend. The Jackets had also lost at home to Dayton earlier in November.

The Jackets hardly sparkled, but combined effort with just enough offense to make it work.

The Jackets fell behind 26-17 with 6:20 to play in the first half in large part because of Illinois’ 3-point game and Tech’s clumsy offense. The Jackets weren’t getting the ball to post players Kammeon Holsey, Miller and Carter with consistency and ill-advised shots abounded.

From that point, Tech went on a 19-7 run over the final 6:19 of the first half. Georges-Hunt was all over the court, challenging shots, deflecting passes, setting up teammates and slashing to the basket. Better defense produced more transition opportunities and the half-court offense found a rhythm. Tech took a 36-33 halftime lead, heading to the locker room with the full-throated support of the Jackets faithful in attendance.

Combined with the final charge over the final 6:22 in the game, the Jackets shot 13-for-20 with no turnovers in those two stretches totaling 12:41. Over the rest of the game, the Jackets were 10-for-36 with nine turnovers. Tech scored 57 percent of its points in 32 percent of the game time.

Over the final 6:22, Tech also limited Illinois to 1-for-9 shooting from the field along with three turnovers, including a shot-clock violation.

“We’ve got a ways to go, but if you give that type of effort and play with that type of intensity, we’ve got a shot,” Gregory said.

Carter led with 21 points on 6-for-10 shooting and nine rebounds. Entering the game shooting 53.8 percent on free throws, he was 7-for-8 from the line.