TUCSON, Ariz. -- Arizona coach Rich Rodriguez told his players all week that to make the program relevant again, they would have to beat ranked teams.

Frustrating the 18th-ranked team in the country while running all over them should be a good start.

Composed after falling into an early hole and a rash of personal foul penalties by their opponent, Arizona picked up a signature win by rolling over No. 18 Oklahoma State 59-38 on Saturday night.

Ka'Deem Carey scored four touchdowns, Matt Scott threw for 320 yards and two scores, and the Wildcats pulled away in the fourth quarter for the kind of win that's sure to turn more attention toward the desert.

"Nowadays, it seems everybody knows the scores, but it seems like they put that Top 25 on that ticker and it goes on and on and on all week," Rodriguez said. "So we're going to be on that ticker all week and I told the guys you want to be on the right side of that ticker."

Arizona (2-0) fell into a quick 14-0 hole before scoring the next 30 points as Oklahoma State (1-1) unraveled under a shower of yellow flags. The Cowboys had 15 penalties for a school-record 167 yards before settling down enough to rally within two points late in the third quarter.

The Wildcats wouldn't let them any closer, scoring 29 points after the 3-minute mark of the third quarter to run away from the Cowboys.

Carey ran for 147 yards in his debut as the featured back last week and followed it up by scoring on two 1-yard runs, another from 25 yards and on a 13-yard screen pass. He finished with 126 yards on 26 carries.

Scott also had a nice follow-up to his dazzling opener, finishing 28 of 41 and running for 55 yards with another score.

"I feel like this makes us relevant," said Scott, who had 461 total yards last week after two years of waiting behind Nick Foles. "We beat a good team, we beat a ranked team."

They also beat a team that beat itself, in some respects.

Oklahoma State freshman Wes Lunt threw for 436 yards, fourth-most in school history and the Big 12 record for a freshman, and connected with Tracy Moore for four touchdown passes. He also had some shaky moments, tossing three interceptions, including one returned 48 yards for a touchdown by Jonathan McKnight in the fourth quarter.

Joseph Randle added 123 yards on 23 carries and the Cowboys finished with 636 total yards, but just couldn't seem to stay out of their own way.

"Way too many mistakes," Oklahoma State coach Mike Gundy said. "It was poor coaching and poor playing. That's a bad combination."

Everything seemed to go right for Oklahoma State in its first game without stars Brandon Weeden and Justin Blackmon, leading to an absurdly easy 84-0 win over Savannah State.

Arizona had a much tougher start in its first game under Rodriguez, needing overtime to pull out a victory over Toledo at home.

That set up a showdown in the desert between familiar foes.

Oklahoma State had beaten Arizona the previous two seasons, in the 2010 Alamo Bowl and in Stillwater last year, by getting off to a fast start, outscoring the Wildcats by a combined score of 44-7 in the first half.

It looked like a repeat on the way after Lunt marched the Cowboys through Arizona's defense the first two drives, hitting Moore on touchdown passes of 9 and 30 yards to put Oklahoma State up 14-0.

The game turned quickly when the Cowboys turned ugly.

Defensive tackle Calvin Barnett was called for consecutive personal fouls on one play, setting up Scott's 15-yard touchdown pass to Richard Morrison.

A fumble by Joseph Randle on the next drive, followed by a late-hit penalty on cornerback Broderick Brown, set up a 22-yard field goal by John Bonano.

A fourth personal foul by Oklahoma State in the half, on linebacker Shaun Lewis for hitting Scott as he slid, led to a third field goal by Bonano, a 24-yarder. Carey added a 1-yard touchdown run -- with a little help from teammates -- late in the quarter to put Arizona up 23-14 at halftime.

Oklahoma State had nine penalties for 110 yards in the half and its last drive ended when Arizona's Jared Tevis intercepted a tipped pass by Lunt at the Wildcats' 29.

"It's undisciplined," Gundy said. "It's on the coaches and then it trickles down to the players. It's bad football."

The second half opened the same way: Barnett was flagged for a late hit on the opening play and Arizona scored on a 13-yard screen pass from Scott to Carey for a 30-14 lead.

But the score seemed to snap the Cowboys out of their funk.

Lunt hit Morgan for a 9-yard touchdown pass and the Cowboys kept marching on Arizona the next drive, setting up Jeremy Smith's 10-yard touchdown run that cut Arizona's lead to 30-28.

It turned out to be their last gasp.

The Wildcats raced down the field on their next drive, setting up Scott's 8-yard touchdown run up the middle. Lunt, facing pressure for one of the few times all game, threw up a weak pass early in the fourth quarter and McKnight picked it off for an easy touchdown. Oklahoma State was called for pass interference on the 2-point try -- naturally -- and Arizona converted on the second attempt to go up 45-31.

Carey sealed it with a 25-yard TD run up the middle and added a 1-yarder for good measure in the closing minutes to send the Zona Zoo into a frenzy and the Wildcats to a look-at-us win.

"There's some excited guys in the locker room and I'm proud of them," Rodriguez said. "It's a nice win, the guys played and made the plays when they needed to."

And with it should come some extra -- and wanted -- attention.