TUCSON, Ariz. -- Southern California had too many penalties, struggled in the red zone and found itself in a late hole for the second straight week.
The Trojans rallied to win a week ago, and they did it again with another pair of late scoring drives.
Resiliency has been the theme so far for USC in this pandemic-shortened season.
"We have some things we need to get better at, but we're 2-0," Trojans coach Clay Helton said. "A lot of teams would like to be in that position."
USC was outplayed by Arizona State last week before scoring two touchdowns in the final three minutes of a 28-27 victory.
The Trojans again rallied late to win a game they were outplayed in for most of Saturday afternoon.
In fact, USC has won both of its games after trailing in the final two minutes. Entering their winning drive last week, the Trojans had a 22% chance to prevail. Entering the winning drive this week, they had a 15% chance to collect the victory. Together, there was only a 3% chance they would win both games, according to ESPN's win probability model.
None of those numbers seemed to matter to the Trojans on Saturday.
Slovis, off target early, completed four straight passes for 68 yards, and Malepeai capped the 75-yard drive by carrying several Arizona defenders with him into the end zone.
"At the end, our kids did what they did last week," Helton said. "When it mattered the most, they never panicked, they showed great poise."
Slovis threw for 325 yards and a touchdown on 30-of-43 passing. He was 11-of-12 for 158 yards on USC's final two drives.
Gunnell threw for 286 yards and three touchdowns for Arizona, which played its first game in nearly a year after last week's opener against Utah was canceled due to the coronavirus.
"There's definitely some disappointment, especially when it's that close and everyone is saying you're the underdog -- literally everyone," Gunnell said. "But we're optimistic and we're driven. That's the 20th-ranked team in the nation and our first game of the year."
The sophomore entered the 2020 season as the starter after sharing time with Khalil Tate last year and had a streak of 92 straight passes without an interception. The streak nearly ended on his first pass against USC and then did on the second, when he overthrew a receiver into Talanoa Hufanga's arms.
That set up Markese Stepp's 1-yard TD run.
Gunnell was much better on the next drive, hitting Jamarye Joiner on a short pass that turned into a 34-yard touchdown.
Arizona kept churning out yards -- 231 by halftime -- but had to settle for three field goal attempts. Lucas Havrisik made two, and USC led 17-13 at halftime after Stephen Carr scored on a 3-yard run with 2½ minutes left.
Arizona tied it at 20 when Gunnell hit Tayvian Cunningham in stride for a 75-yard touchdown reception in the third quarter.
USC struggled in the red zone early in the second half.
Amon-Ra St. John pulled down a spectacular 48-yard catch, but the Trojans stalled and settled for Parker Lewis' 28-yard field goal. Stepp ripped off a 49-yard run on the next drive, and USC marched down to Arizona's 1-yard line. Consecutive penalties backed the Trojans up, and Lewis pushed a 28-yard field goal wide right.
Another drive into the red zone, another trip without points. This time, Arizona stopped the Trojans on fourth-and-1 from the Wildcats' 4.
Havrisik gave Arizona its first lead at 23-20 with a 51-yard field goal midway through the fourth.
"You either win or lose, but we had some experienced guys we expected to play well and obviously some newcomers, whether they were transfers or young guys that played well, but not well enough to win," Arizona coach Kevin Sumlin said. "That's the bottom line."
The Associated Press contributed to this report.