STILLWATER, Okla. -- The dark circles around coach Sean Sutton's eyes showed just how desperate Oklahoma State was to end a six-game losing streak.
"If it was by 50, if it was by half a point, as long as we got the win, that's all that matters," senior guard Byron Eaton said.
In the end, it was by one point, but it was enough for the Cowboys. James Anderson scored 16 points as Oklahoma State ended its longest skid in more than two decades by beating Colorado 64-63 on Wednesday night.
Oklahoma State (11-11, 2-6 Big 12) won for the 21st time in its last 22 home games against Colorado (9-13, 1-7) in a matchup of teams that entered Wednesday tied for last place in the conference.
Until this season, the Cowboys hadn't lost six straight games since the 1986-87 season.
"Any win after what we've been through will help their mind-set and help their confidence," Sutton said. "... During this streak when we lost so many close games, they never put their head down and never felt sorry for themselves. They continued to work hard on the practice court and continued to get better."
Colorado can feel their pain. The Buffaloes lost their sixth straight game despite 22 points from Richard Roby, who set a school record with his 106th career start, breaking a mark set by Donnie Boyce from 1991 to 1995. Colorado has lost 17 straight Big 12 road games, dating to a 2006 win over the Cowboys at Gallagher-Iba Arena.
"This game was lost in the first 20 minutes," Colorado coach Jeff Bzdelik said. "We avoid contact going to the rim. We double clutch, so we don't finish layups. And then we avoid contact on defense. We didn't take one charge with them flying to the rim, bailing them out with unnecessary fouls and just giving them second-chance opportunities and missing free throws.
"You're not going to win any games doing those kinds of things."
Colorado rallied from a 9-point halftime deficit to tie the game at 36-36 on two free throws by Roby with 10:13 left. But Terrel Harris started a 9-0 Oklahoma State run with two free throws with 9:06 left. He capped the spurt with a dunk that followed a steal and pass by Eaton and put the Cowboys up 45-36 with 6:05 left.
Eaton's steal gave him 170 for his career, tying him for Oklahoma State's career lead in that category with Ivan McFarlin, who played for the Cowboys from 2001 to 2005.
Cory Higgins pulled Colorado within 49-46 with a 3-pointer from the corner with 2:56 left. Marcus Dove and Eaton each hit a pair of free throws for Oklahoma State to make it 53-46.
Colorado chipped away at its deficit, and a 25-foot 3-pointer by Marcus Hall with 4.1 seconds left cut the Cowboys' lead to 61-59. Eaton, who had 13 points, made 3 of 4 free throws after that, including a pair with 1.2 seconds left after Roby had hit 1 of 2. That proved to be the difference, as Hall's half-court heave at the buzzer went in.
"I'm glad the game didn't go one more minute, the way they were hitting shots at the end," Sutton said.
Despite the dramatic finish, the mistakes came early and often for both teams. Colorado's Dwight Thorne threw up an off-balance 3-point attempt with the shot clock running down to end the game's initial possession, and Oklahoma State answered with a turnover.
Then came a Colorado turnover and another Oklahoma State turnover before Thorne scored the game's first basket, more than two minutes after the tipoff.
The errors sometimes were odd in nature, as when Oklahoma State's Nick Sidorakis was called for traveling -- while trying to inbound the basketball.
But Martavius Adams provided a bright spot for Oklahoma State. He broke his career high for rebounds by grabbing nine in the first half and scored three baskets -- all putbacks -- as the Cowboys took a 25-16 halftime lead. Adams had only hit one basket in the Cowboys' seven previous Big 12 games.
Colorado went 5 of 20 from the field in the first half and made just 4 of 10 free throws. The Buffaloes didn't hit double figures in the scoring column until 15 minutes into the game.
If Roby hadn't of made a buzzer-beating 3-pointer at the end of the half, Colorado would have allowed Oklahoma State to set a new school record for fewest points allowed in a half against a Big 12 team. The Cowboys held Baylor to 14 first-half points on Feb. 14, 2004.
Hall scored 12 points, raising his career total to 1,008. He is the 25th player in school history to score 1,000 points or more in his career.
Ibrahima Thomas added 9 points and 10 rebounds for Oklahoma State.