This post was updated Oct. 21 at 12:45 a.m.

Wilton Speight started the second half, but after two series, that looked like the wrong decision.

UCLA went three-and-out, and on the first play of the next possession the graduate transfer quarterback fumbled, handing the ball right back to Arizona’s offense.

The Wildcats (3-5, 2-3 Pac-12) immediately scored a touchdown to tie the game, but Speight steadied the ship and led the Bruins (2-5, 2-2) to a come-from-behind 31-30 win Saturday night.

“Part of being a good football team is you have to finish,” coach Chip Kelly said. “Tonight, we were fortunate enough to finish.”

UCLA held on for the victory despite the loss of its starting quarterback and a season-high 12 penalties for 103 yards.

Freshman quarterback Dorian Thompson-Robinson left the game early in the second quarter after getting sacked. He walked into the locker room but returned to the sideline before halftime, albeit without his helmet.

Thompson-Robinson warmed up with his teammates after halftime but sat on the bench as his teammates took the field, still without his helmet. Kelly said postgame the freshman had been ruled out for the rest of the game at halftime.

In a role reversal from the season opener against Cincinnati, it was the veteran Speight coming on in relief and leading UCLA to a win.

“I feel very happy, relieved that I was able to get back in and play the game that I love,” Speight said. “I worked so hard this offseason to get back and get ready, and for (the injury against Cincinnati) to happen so soon was disappointing. … If an opportunity like this presented itself, I wasn’t going to let it slide.”

After Arizona kicked a field goal to go ahead by three points 10 minutes into the second half, Speight found redshirt sophomore wide receiver Demetric Felton for a 25-yard touchdown pass to punctuate a six-play, 75-yard drive.

And after the Wildcats added another touchdown to pull back ahead, UCLA scaled the length of the field in only four plays to answer.

Redshirt junior running back Joshua Kelley scored the go-ahead 28-yard rushing touchdown early in the fourth quarter as he compiled his fourth consecutive 100-yard performance. Kelley finished with 136 yards on 31 carries.

“What we’re doing is working,” Kelley said. “We have a very young team and now that we’ve got some experience winning games, now we’ve got some momentum.”

On the other side of the ball, UCLA couldn’t stop the run, even with quarterback Khalil Tate out injured.

JJ Taylor and Gary Brightwell, Arizona’s top two running backs, combined for 275 yards on 34 carries, including runs of 55 yards by Taylor and 72 yards by Brightwell.

The Bruin defense’s lone highlight in the run game came courtesy of sophomore cornerback Darnay Holmes.

On Taylor’s 55-yard run, there was only open grass separating him from a touchdown. But Holmes sprinted from behind and punched the ball out as Taylor crossed the 5-yard line. The ball bounced into the end zone, and Holmes picked it up and fell out of bounds for a touchback.

But despite winning the turnover battle three to one, UCLA couldn’t manage any points following takeaways.

On each of the three drives immediately following a turnover, the Bruins had a three-and-out, totaling negative six combined yards.

The combination of forcing two red zone turnovers and holding the Wildcats to three red zone field goals was enough to overcome 520 total yards and 7.2 yards per play.

With the win, UCLA is tied in the loss column of the Pac-12 South Division standings, one win behind Utah and USC.

“The team, that locker room, is filled with winners, led by a coaching staff full of winners,” Speight said. “We’re going to keep winning each day and winning each meeting and winning each practice, and stack little wins until the outcome is what we want every Saturday.”