NEW YORK (AP) — Terrence Shannon Jr. scored 12 of his 16 points in overtime, including the tiebreaking 3-pointer with 3:34 remaining, and No. 17 Illinois rallied to hand second-ranked Texas its first loss of the season, 85-78 on Tuesday night in the Jimmy V Classic.

Jayden Epps added 11 points, including the final five points of regulation — a 3-pointer with 35 seconds left and two tying free throws with 8 seconds remaining. Epps then blocked Marcus Carr’s jumper in the lane just before the buzzer to force overtime in an entertaining showdown at Madison Square Garden.

Matthew Mayer, who faced Texas several times at Baylor, tied a career high with 21 points as he made his first seven shots and finished 8 of 10.

Shannon, who missed eight of nine shots in regulation, took over in the extra period to help Illinois (7-2) beat a ranked foe for the second time this season. He opened overtime with a jumper after Carr was called for traveling and then hit an open 3 from the right wing over Brock Cunningham for a 73-70 lead.

“I was telling my teammates way to keep us in it, they were just great,” Shannon said. “I just kept telling them, like praising them, ‘Man, good job, you’re keeping us in it, you’re all playing great. I got you and I’m going to come through for you eventually,’ and that’s what I kept telling them in overtime.”

Shannon converted a reverse layup and finished a three-point play to make it 77-70 with 2:16 left. Carr hit two free throws to get Texas within one with 1:28 remaining.

Jayden Epps made a layup, RJ Melendez sank two free throws to put Illinois ahead by five, and Shannon made two free throws with 27.7 seconds left.

“They were all under control,” Illinois coach Brad Underwood said. “They were all poised.

“Those were plays that weren’t just reckless. Those were plays that were poised, patient and he stopped to make the right play. Just really good basketball plays.”

Shannon, who received four stitches under his right eye during Friday night’s loss at No. 13 Maryland, came through against his former coach Chris Beard, for whom he played two seasons at Texas Tech.

“When it came to winning time, he played his best,” Beard said of Shannon.

Timmy Allen scored a season-high 21 points for Texas (6-1), which failed to open 7-0 for the first time since 2014-15. Tyrese Hunter added 10 points but Carr was held to nine points on 3-of-14 shooting as Texas had 12 shots blocked and shot 42%.

Texas took its only double-digit lead when Dillon Mitchell hit a layup with 8:28 left. Illinois cut the lead to 58-56 on a 3 by Melendez nearly four minutes later. After Cunningham hit an open 3 with 4:15 remaining, Si’Jabari Rice made a 3 for a 64-58 lead.

Allen found Cunningham for an open jumper that counted when officials called goaltending on Illinois’ Coleman Hawkins. That gave Texas a 66-61 lead with with 1:51 remaining.

Carr’s rainbow jumper in the lane made it 68-63 with a minute left and Illinois had a 3-pointer by Melendez waved off because it called timeout with 45.3 seconds left.

After the timeout, Epps made an open corner 3 with 33 seconds remaining.

Hunter missed the front end of a 1-and-1 to set up Epps’ tying free throws and subsequent block against Carr.

“I think Marcus’ heart was in the right place, he was trying to go win the game but probably too crowded,” Beard said. “Probably should have kicked it out.”

BIG PICTURE

Illinois: The Illini continued to struggle with turnovers, committing 17. But only two of them came in the final 10-plus minutes of regulation or overtime. Illinois’ 15th turnover was an offensive foul by Mayer, which sent him to the bench with four fouls with 10:42 remaining. Several of the turnovers were offensive fouls, something Illinois had practiced because the Longhorns take a lot of charges.

Texas: The Longhorns had little offense beyond Allen and Hunter. While the duo was a combined 13 of 29, the rest of the team missed 24 of 40 shots.

UP NEXT

Illinois hosts Penn State in its second Big Ten game on Saturday.

Texas hosts Arkansas-Pine Bluff in the Jimmy Blacklock Classic on Saturday.

___

AP college basketball: https://apnews.com/hub/college-basketball and https://apnews.com/hub/ap-top-25-college-basketball-poll and https://twitter.com/AP_Top25