Updated

Texas Tech was so close to earning its third win of the season over a Top 25 team in coach Tubby Smith's first season leading the Red Raiders.

But they came up just short in a 64-63 defeat to No. 8 Kansas on Tuesday night.

"They're down, they're despondent because it's a tough loss," Smith said of his players. "I'm disappointed for them that we didn't get this win because we played so hard. We played a lot smarter. We got the tempo the way we wanted to. We've got to regroup."

Texas Tech will play at Oklahoma State on Saturday. It will Marcus Smart's first game back after the Cowboys player was suspended for three games for shoving a Red Raiders fan on Feb. 8.

Andrew Wiggins' layup with two seconds left lifted Kansas to this victory on Tuesday.

"My heart was just racing," Wiggins said. "They're a great team, though. They're a lot better than their record is."

The freshman finished with 19 points, and Joel Embiid matched his career high with 18 to lead the Jayhawks (20-6, 11-2). The victory gave Kansas 20 wins for the 25th consecutive season and 11 conference wins for the 20th straight year.

Texas Tech's Robert Turner sank two free throws with 16 seconds left to put the Red Raiders up 63-62, but Kansas brought the ball up and got it inside to Wiggins for the win.

Jordan Tolbert scored 16 points, and Dejan Kravic added 13 to lead Texas Tech (13-13, 5-8).

The Jayhawks took a two-game lead in the Big 12 after Texas fell 85-76 at Iowa State on Tuesday night.

The game was tied nine times and the lead changed 13 times.

"It's just tough," Texas Tech's Jaye Crockett said. "Everybody fought. The team fought hard, and when you fight that hard it hurts a lot at the end when you just can't finish it."

Kansas held an early 10-point lead but Texas Tech started hammering the ball inside to make the game tight.

Tolbert made a basket as the shot clock expired with 2:51 left to put the Red Raiders up 59-55. But Wayne Seldon, Jr. hit a clutch 3-pointer to make it 59-58. Turner answered with a basket, and Embiid sank two free throws to make it 61-60 with 1:22 left.

On the Red Raiders' next possession a scrum led to Kansas regaining the ball. Embiid dunked it to put the Jayhawks up 62-61.

Turner then made his free throws, and Kansas called a timeout to draw up the winning play.

Kansas scored 22 points from the free throw line. Texas Tech netted only nine.

Texas Tech came out after halftime and hit four of its first five shots. Kansas sank only one shot in four attempts, allowing the Red Raiders to take their first lead since early in the game, 37-32.

Tolbert capped Texas Tech's 8-2 run.

The Red Raiders' effective defense against the Jayhawks also brought foul trouble. With more than 13 minutes remaining, Jaye Crockett, Kravic and Kader Tapsoba each had three fouls.

Texas Tech sent the Jayhawks to the line often in the second half. Five free throws — by Jamari Traylor and Wiggins — on three possessions pulled Kansas within 46-45 with about 11 minutes remaining.

The Jayhawks regained the lead for the first time in 11 minutes, 52-51, on a pair of free throws by Naadir Tharpe with 7:14 remaining.

But with Kravic back in and after a turnover by Tharpe, the 7-foot senior tied it at 53 on a layup with 5:34 left.