TUCSON, Ariz. -- The first blocked extra point by James Brooks, at the end of regulation, was dramatic, adding a wild chapter to a rivalry that's been filled with crazy plays.

That second one? C'mon. That's getting a little surreal.

Brooks leaped for a game-saving block on Alex Zendejas' extra point late in regulation and did it again in the second overtime, helping Arizona State enhance its bowl chances with an improbable 30-29 win over rival Arizona (No. 23 BCS) on Thursday night.

"All week, we watched film, and his trajectory was low," Brooks said. "We knew if we got a good push in the front and jump high, we could get a block. I happened to get two."

Brooks' leaps put an ironic twist to an odd season for the Sun Devils and an exclamation point on an emotionally draining game.

Arizona State (6-6, 4-5 Pac-10) rallied from an eight-point deficit in the fourth quarter, only to allow Arizona (7-5, 4-5) to march down the field for a tying touchdown, one point from ending the Sun Devils' season.

The 6-foot-5 Brooks came through when his team needed him most, sending a groan through Arizona Stadium and the game to overtime by high-jumping to get Zendejas' kick.

That just set up the encore.

After matching field goals by Zendejas and Thomas Weber -- his fifth -- in the first overtime, Arizona State's Cameron Marshall bulled his way through for a 2-yard score. Arizona had a quick answer, with David Douglas taking a back pass in from 9 yards out.

The game seemed headed to a third overtime, but Brooks sprang again, leaping up to get a chunk of another of Zendejas' kicks, sending it wobbling just past the right upright and his teammates rushing to the field.

A team that allowed two blocked PATs in close losses earlier in the season, Arizona State got two in one game for a win that might sway the NCAA into clearing its bowl waiver request.

"The football gods got on our side," Arizona State coach Dennis Erickson said. "I guess the extra-point gods got on our side."

The Wildcats have to wonder whether anyone is on their side.

Arizona had been bowl eligible for a month but was on course for a smaller bowl after losing three straight.

Shaking off a miserable first half, the Wildcats rallied behind Nick Foles (262 yards, three TDs) to take a lead into the fourth quarter and marched for what seemed to be the tying score with 27 seconds left.

Arizona's fate was sealed by Brooks' leaps, sending the Wildcats to a fourth straight loss that has them wondering where they'll end up come bowl season.

"Now we just have to regroup," Arizona coach Mike Stoops said. "The loss is certainly disappointing. It would have been nice to finish better."

Especially with the way this game started.

Perhaps anxious about the stakes in an always-unpredictable rivalry game, the Wildcats and Sun Devils were making the Duel in the Desert seem more look like the Dud in the Desert.

Looking like they were playing under water, Arizona and Arizona State traded go-nowhere runs, dropped interceptions and badly overthrown passes throughout an ugly first half. They combined for 88 total yards in the first quarter, 14 punts in the first half -- one 8 yards, another 0 -- and just six points, on field goals of 52 and 36 yards by Weber.

Arizona was the first to snap out of it.

Back in rhythm after a 49-yard first half, Foles hit Terrence Miller on a pump-faking 38-yard pass down the middle, then hooked up with Juron Criner on the next play, pinpointing a pass in the corner of the end zone for a 28-yard touchdown.

Criner made it 14-6 late in the third quarter, giving Arizona State cornerback LeQuan Lewis a slight bump on an up-for-grabs ball to score a 52-yard touchdown for a 14-6 lead.

"We had to figure some things out, blocking schemes, what they were doing," said Foles, who was 22-of-36. "At halftime, we made adjustments and got each other going."

So did Arizona State.

Brock Osweiler opened the fourth quarter by engineering a drive to set up a 38-yard field goal by Weber, then another that ended with a 3-yard touchdown pass to Mike Willie and a 2-point conversion that put the Sun Devils up 17-14. After the defense held on a fourth down near Arizona's 30 on the next drive, Weber nailed a 40-yard field goal to make it 20-14 with 3 minutes left.

Arizona State left a little too much time for Foles, who hit Douglas on a 5-yard score to tie it at 20-all and in position for the last-second win.

James wouldn't let them have it, coming through with one block and then another to add drama and emotion to a rivalry already filled with plenty of both.

"I started crying a little bit," Arizona State linebacker Brandon Magee said. "I'm not a sissy, but I'm not going to lie, I cried a little bit. It is the best feeling ever."