MANHATTAN, Kan. -- Kansas State's Marcus Foster was battered and bruised, just like everyone else on the court, and was having a hard time limping around during breaks in the play.
When the final buzzer sounded, he had no problem jumping up in celebration.
Foster scored a game-high 20 points, two coming on free throws in the closing seconds of overtime, and helped the Wildcats hold off No. 7 Kansas 85-82 on Monday night.
"Marcus is Marcus," Kansas State coach Bruce Weber said of the freshman. "He hit a lot of big shots."
Will Spradling added 15 points for the Wildcats (17-7, 7-4 Big 12), who blew a nine-point lead with less than 2 minutes left in regulation, only to survive for just their third win over the Jayhawks (18-6, 9-2) in 26 games played at Bramlage Coliseum.
Hundreds of students flooded the court when the final buzzer sounded to celebrate the end of a six-game skid against Kansas. The Wildcats, who had lost 48 of the last 51 in the series, hadn't beaten their rivals in their on-campus octagon since Feb. 14, 2011.
"We just went out there and played hard," said Foster, who turned his right ankle and showed up to the postgame news conference in a walking boot. "We knew if we played hard, the rest would take care of itself."
Andrew Wiggins scored 16 points for the Jayhawks, including a putback of his own miss with 6.9 seconds left to force overtime. Perry Ellis had 19 points, Naadir Tharpe added 13 and Brannen Greene scored 10, making two key baskets near the end of regulation.
"I thought momentum was on our side," Kansas coach Bill Self said.
Tarik Black even scored the opening basket of overtime, but every time the Jayhawks tried to build a lead, the Wildcats had an answer -- a three-point play by Foster, a free throw by Omari Lawrence, or a big putback from unheralded big man D.J. Johnson, who had nine points.
"We felt good. We felt energized," Ellis said. "We just couldn't get no stops. We couldn't get no stops in the second half and overtime."
Still, it wasn't over until Foster's two free throws with 21.9 seconds left gave Kansas State an 83-79 lead, and Wiggins missed a 3-pointer at the other end. Black missed another shot, and the Wildcats finally corralled the rebound, allowing time to run out.
"If we lost," Weber said, "it would have been a heartbreaker."
Unlike the first meeting in January, when the Jayhawks raced out to a big lead and then simply nursed it through the second half, the rivals played to a draw Monday night.
Kansas State surged to an early lead thanks to some poor shooting by the Jayhawks, only to go into a slump of its own. Both teams eventually got into foul trouble as the game began to resemble an old Big Eight tussle, and the result was a 29-29 halftime tie.
In fact, there may have been more bodies on the court than baskets made, and the Jayhawks' Black even had to limp off after twisting his ankle while going up for a rebound.
Joel Embiid played only 18 minutes for the Jayhawks, scoring six points on 2-of-5 shooting. After the game, Self told reporters the freshman center was "beat up" with back and knee ailments and might miss time, although he would not speculate how long Embiid might be rested.
"I'm not going to make one excuse for him, because if you're out there you have to (perform), but certainly he's going to get some time off," Self said.
Kansas was already playing without reserve forward Jamari Traylor, whom Self sat for disciplinary reasons. With the nagging injury to Black on top of the foul trouble, one of the deepest teams in the nation had its depth tested in one of the rare instances all season.
After taking a 35-34 lead with 17:34 remaining, the Wildcats ripped off the next nine points. And even when Foster turned his ankle and briefly went to the locker room, Kansas State was still able to match the Jayhawks basket for basket.
The Wildcats couldn't close the game in regulation, though.
Wesley Iwundu made one of two free throws with 30 seconds left to give Kansas State a 69-65 lead, but Tharpe quickly answered with a layup. Iwundu was fouled again but missed the front end of a 1-and-1, giving Wiggins a chance to send the game to overtime.
The Wildcats simply refused to give up.
"We made mistakes," Weber said. "To their credit they came back, but our character, and that's something we talked about, let us overcome the emotion."
The Associated Press contributed to this report.
2021-22 men's college basketball preview: Preseason picks, rankings, complete coverage
The countdown to the 2021-22 college basketball season has begun. Your preparation begins right here.
Big 12 2021-22 men's basketball predictions: Stacking Kansas, Texas and Baylor in title race
As the countdown to the 2021-22 college basketball season continues, ESPN's conference predictions series continues with the Big 12.
Coach Chris Beard, Texas men's basketball secure commitment from 2022 recruit Dillon Mitchell
Coveted five-star recruit Dillon Mitchell on Monday chose Texas over Florida State and Tennessee, giving new coach Chris Beard's 2022 class a major boost.