STILLWATER, Okla. -- With a lengthy wait and the game on the line, Jason Ricks had nothing on his mind but going through his routine. It was before and after that the emotions really set in.
Ricks kicked a 26-yard field goal with 2 seconds remaining and Oklahoma State overcame the best passing performance of Josh Freeman's career to beat No. 25 Kansas State 41-39 Saturday night.
It was sweet redemption for Ricks, who had an extra point blocked in overtime on homecoming last year to send Oklahoma State to a defeat against Texas A&M.
"That one kind of still sticks with you until you get one like that to really let it go," Ricks said.
This one also provided revenge for the Cowboys (5-3, 3-1 Big 12), who squandered a 10-point lead in the final 3:04 in a loss at Kansas State last year. Adding to the drama was K-State coach Ron Prince deciding to go for the 2-point conversion and the lead instead of the tie after Leon Patton's 11-yard touchdown run with 1:10 remaining.
Freeman, who'd already thrown three touchdown passes to Jordy Nelson, found him again while Nelson was backing up in the right side of the end zone to put Kansas State up 39-38.
"That was a great call by coach Prince, a gutsy call on his part, very well planned to go for 2," Oklahoma State coach Mike Gundy said. "I mentioned to the team that we've come a long ways as a group because with the call he makes, he takes the wind out of your sails as a football team if you're not careful."
Instead of being deflated, the Cowboys came back to beat a ranked team at Boone Pickens Stadium for the third straight season.
Tommy Devereaux returned the ensuing kickoff to the Oklahoma State 42, and Zac Robinson threw a 24-yard pass that tailback Dantrell Savage leaped and twisted to catch to set up Ricks' field goal.
Savage came in with only 18 receptions in 16 career games.
"Seldom do we practice that play," Robinson said. "He went up, I threw it, and he made a great play adjusting to the ball with a guy right in his face. I've never seen him really make that catch, but I'm glad he did tonight."
Prince credited Robinson, making his first start against a ranked opponent, for performing in a pressure situation.
"All it took was one mistake for us to get the wrong match-up on the wrong player, and he was able to find him," Prince said.
The Cowboys ran the ball twice to drain the clock and get the ball to the center of the field, and the Wildcats (4-3, 2-2) called all three of their timeouts as Ricks was setting up. His kick was right down the middle.
"Right now, I feel like I'm a 40-year old man. I'm sitting over there stressed out thinking it's probably going to come down to me," Ricks said. "The game's so long. I'm sitting there for so long, watching the game develop. ... What a difference a year makes."
Freeman, who'd never thrown for more than 305 yards in a game, passed for a 404 yards, but it wasn't enough for the Wildcats.
Oklahoma State's players rushed off the sideline when Kansas State's last-ditch kickoff return ended with only one lateral.
Robinson was 11-for-25 for 181 yards and three touchdowns, including two to freshman Dez Bryant, and he also ran for 109 yards as the nation's sixth-ranked rushing attack piled up 329 yards.
Savage had 124 yards and a touchdown on 28 carries.
Nelson finished with 176 yards on 12 receptions. He had a 17-yard touchdown catch as K-State opened an early 14-0 lead, and he beat cornerback Perrish Cox down the left side for a 46-yard TD grab that made it 21-7.
Cox came right back by returning the kickoff 98 yards for a score, and that sparked a run of 17 straight points for the Cowboys. Savage's 7-yard score on the opening possession of the second half gave Oklahoma State its first lead of the game at 24-21.
K-State responded with Freeman's third touchdown pass of the game to Nelson, a 10-yard connection as Nelson ran across the front of the end zone. K-State was driving toward another score when a pair of mistakes turned the tide in Oklahoma State's favor.
Tight end Jeron Mastrud caught a pass from Freeman that would've set up a first-and-goal, but had the ball knocked away by linebacker Donovan Woods and the Cowboys recovered. After forcing a three-and-out, the Wildcats gave the ball right back to Oklahoma State when Matt Fodge's wobbly punt bounced off K-State receiver Cedric Wilson and the Cowboys got it again.
Bryant's second TD catch, a 10-yarder, put Oklahoma State up 31-28 with 13:45 to play.
"We had those things that cause you to lose," Prince said.