Stanford rallied from a double-digit first half deficit to upset the No. 6-ranked Trojans, 41-31, handing them their first loss of the season on Saturday night at the Los Angeles Memorial Coliseum.USC (2-1, 0-1), which lost its Pac-12 opener for only the third time in its last eight tries, jumped out to an early 21-10 lead behind a five-yard touchdown run on the team’s first drive of the game by senior Tre Madden and a couple of passing touchdowns from redshirt senior quarterback Cody Kessler to redshirt sophomore Steven Mitchell Jr. and sophomore JuJu Smith-Schuster.Stanford (2-1, 1-0), however, did not panic with fifth-year quarterback Kevin Hogan and the Cardinal offense accumulating 474 yards in total offense on its way to outscoring the Trojans 31-10 from that point on to secure the Pac-12 upset on the road and, for Hogan, the first win over USC in his career.“Stanford came ready to play like we knew they would,” head coach Steve Sarkisian said. “They are an extremely well coached football team and came out and executed their game plan on a high level.”Coming into the game as double-digit underdogs, Stanford snapped USC’s two-game winning streak in the two team’s Pac-12 rivalry and also gave it its fourth win out of its last five visits to Los Angeles.With starting cornerback Kevon Seymour out, the USC secondary struggled to contain the Stanford passing game and Hogan finished the game 18-for-23 for 279 yards and two touchdowns. Kessler quietly posted a three-touchdown game, while going 25-for-32 for 272 yards.The Stanford ground game also gave the Trojans defense trouble, accounting for 218 yards on the ground led by sophomore Christian McCaffrey who rushed for 120 yards on 26 carries. Fifth-year senior running back Remound Wright punched the ball into the end zone three times for the Cardinal, with two of them coming consecutively to give Stanford a 10-point lead early in the fourth quarter.“We had them in situations, but we didn’t execute and we couldn’t get them off the field,” junior linebacker Su’a Cravens said. “They were able to make some long drives, [and] it was hard to stop them.”The Cardinal trailed USC 21-17 late in the second quarter before Hogan marched his offense down in a two-minute drill that was capped with a 17-yard touchdown pass to fifth-year senior Devon Cajuste to give Stanford a 24-21 lead at halftime.The Trojans forced the Stanford offense to a three-and-out to begin the second half and retook the lead after a one-yard touchdown pass from Kessler to Mitchell, their second connection of the game. Stanford, though would recapture the lead after a Wright touchdown with almost five minutes left in the third quarter and would never give it back.“I thought we came out with good energy, got a stop and went down and scored, but we have to look at the tape and see what needs to be done,” Sarkisian said.A 46-yard field goal by Stanford kicker Conrad Ukropina with 2:27 remaining made it a two-possession game and sealed the deal late in the game for the Cardinal.The Trojans were especially hurt in penalties. The team was penalized eight times, which accumulated for 87 yards including a few in critical moments. Sophomore Adoree’ Jackson ran a kickoff back for a touchdown in the second quarter, but it was nullified by a holding penalty, to go along with a personal foul penalty by Smith-Schuster that sent the offense back to its own seven-yard line.“Some drives we had some momentum but penalties killed us,” Kessler said.The ball was also in the hands of the Cardinal for the majority of the game, wining the time-of-possession battle by almost double, 39:29-20:31.“It hurt the rhythm a little bit,” Kessler said. “We have to capitalize when we do get possession.”The preseason Pac-12 favorite, USC failed what was deemed its first true test of the season after handily beating its previous two Sun-Belt opponents by almost 100 points combined.“Football is a humbling sport,” Sarkisian said. “Emotions can go from high to low quickly … We need to play football the way we’re capable of playing.”After a three-game home to stand to start the season, the Trojans will look to rebound from the loss in its first road test next Saturday when they travel to Tempe, Arizona to take on Arizona State. Kickoff is at 7:30 p.m.