With starter Zac Robinson injured and backup Alex Cate ineffective, Weeden took over in the second half and got the offense going for the Cowboys (9-2, 6-1 Big 12).
His 28-yard touchdown pass to Justin Blackmon with 8:11 remaining proved to be the winner, keeping pressure on No. 3 Texas in the Big 12 championship race. The Longhorns would have clinched the Big 12 South with an OSU loss.
Colorado got out to a 21-10 lead against the one-dimensional Cowboys before Weeden finally provided a viable passing threat. He went 10-for-15 and threw a 47-yard touchdown pass to Keith Toston.
The Buffaloes (3-8, 2-5) had one final chance to go for the win after stuffing OSU on fourth-and-short for the third time in the game with 3:14 remaining but decided to punt after Tyler Hansen threw three consecutive incomplete passes. The Cowboys, the top rushing team in the Big 12, ran the final 2:45 off the clock.
It was only the second win for Oklahoma State against Colorado in the teams' last eight meetings in Stillwater.