"They beat us any way you can get beat," Barnes said. "Right from the beginning whether you want to talk loose balls or from turning the ball over, you are not going to win with turning the ball over 18 times. Some of it had to do with them, but a lot of it had to do with what we were doing, too."

Foster's 34 points were the most for a Kansas State freshman since Michael Beasley's 39-point performance against Kansas on March 1, 2008. Foster's previous high was 25 points against Oral Roberts on Nov. 13.

Will Spradling added nine points for the Wildcats (16-7, 6-4 Big 12) who extended their home winning streak to 12 games. The win improved coach Bruce Weber's record at Bramlage Coliseum to 29-2, 13-1 in conference games.

Isaiah Taylor had 17 points for the Longhorns (18-5, 7-3) while Connor Lammert added eight points. Texas entered the game with four players averaging in double figures.

Foster's impressive dunk off an alley-oop pass was the highlight of an opening 18-4 run for the Wildcats over the game's opening 8 minutes.

"He did not get any resistance," Barnes said. "He played terrific. As a team they did whatever they wanted to do. He did a terrific job, and they really deserved to win. The score is not really indicative of how bad they really beat us. He was terrific."

Kansas State held the Longhorns to 3-of-8 shooting with six turnovers through the 11:41 mark of the first half. Texas finished the half at 25 percent (5 of 20).

Texas' shooting percentage was its second-lowest of the season and it followed Tuesday's performance as the two worst of the season both by percentage and score.

"The big thing was the defense," Weber said. "Holding them to 32 percent and they had 18 turnovers. It allowed us to get transition points. I don't know if we've had fast breaks like that altogether all year as many as we had today."

Javan Felix and Cameron Ridley were held to only five combined field goals (5 of 19). Ridley, who scored 18 points in the team's first meeting on Jan. 21, struggled mightily in getting comfortable against the Wildcats interior.

"I was baffled by some of the things that we did," Barnes said. "We were not shooting the ball well."

Texas forward Jonathan Holmes left the game with a knee injury. The junior scored the game's first basket and attempted only two shots before leaving.

Barnes said Holmes will be evaluated when the team returns to Austin. He will undergo an MRI on Sunday.

The 17-point first half by Foster was the best 20 minutes by any K-State player this season. He nearly outscored the Longhorns by himself as the Wildcats led 39-18 at halftime.

"Part of their execution was that they defended the way they wanted to defend and we couldn't handle it," Barnes said. "We have to give them credit for that."

Taylor, who had 15 points in the second half, helped Texas climb within 16 points with 12:15 left in the game, but the Wildcats quickly answered and pushed their lead over 20 points in less than a minute. Each of those baskets was by Foster.

"Texas is a team that makes a lot of runs," Foster said. "I just felt like they were making their run in trying to come back. I was in the right spot to make plays and my teammates found me."

Foster was the third Kansas State true freshman to score 30 points joining Beasley and Mike Evans.

After a minor injury on a hard foul forced Kansas State's Thomas Gipson to sit with 4:47 left, Foster closed his performance by hitting both free throws in place of Gipson.

Information from ESPN.com's Andy Katz and The Associated Press was used in this report.