It’s rare to win game when trailing after the eighth inning, even in the pitching-challenged California League, but both the Quakes and the Mavericks did exactly that on Thursday night.

The win by the Quakes (19-14 second half) gave them a one-game lead over second-place Lancaster (18-15), while the Sixers’ loss to the Mavericks dropped them to 18-16, in third place a game and a half back.

Down 8-6 going to the bottom of the ninth, the Quakes rallied for their third such win this season with two in the ninth, and Mark Trumbo’s walk-off two-run homer in the 10th for a 10-8 victory.

It was the first time all season Stockton lost a game when leading after eight innings (47-1). Stockton was the last team in the league to be perfect when leading after eight, while the Quakes improved to 3-43 when trailing after eight.

Meanwhile, the Sixers built a 10-5 lead going to the bottom of the ninth against the Mavericks at Adelanto. However, the Mavericks rallied in the ninth on a Jamie McOwen grand slam, an RBI single by Kuo Hui Lo, and a Carlos Triunfel sacrifice fly to take an improbable 11-10 victory. Not as improbable as it might be for other teams. It is the Mavericks’ league-best sixth win (6-52) when trailing after eight. No other team has won more than three times and the Sixers have yet to do it. The Sixers dropped to 47-3 when leading after eight.

As for the Quakes, Drew Toussaint hit a homer to right with one out in the ninth to bring them to within a run.

Larry Infante then reached on an infield single and with two outs, Anthony Norman struck out. But the ball eluded catcher Josh Donaldson for a wild pitch, allowing Norman to reach base.

Pinch-hitter Abel Nieves came through with an RBI single to left to tie the score 8-8 and send the game to extra innings.

In the 10th, Hank Conger was hit by a pitch with one out before Trumbo launched his 25th home run off the scoreboard in right field.

“It was a fastball. The first one I’d seen all day,” Trumbo joked.

Trumbo had been 0-for-5 with three strikeouts up to that point, and could’ve been ejected by home plate umpire Jonathan Bailey after striking out to end the sixth inning for arguing balls and strikes. Manager Ever Magallanes had been ejected by Bailey in the top of the sixth inning for arguing balls and strikes.

“We weren’t getting that call all game,” Trumbo said. “He could’ve easily tossed me, but I didn’t say ‘you’ with anything I said to him. I was glad to get another chance. You should talk to the other guys. They all contributed.”

They certainly did, since the team had 19 hits and all nine starters, plus pinch-hitter Nieves, had hits. Peter Bourjos (3-for-6, two runs, RBI) and Larry Infante (3-for-5, run, RBI) each had three hits, while Trumbo, Conger and Toussaint each drove in two runs.

Toussaint extended his hitting streak to 19 games with a pair of hits.

Wasted in the Sixers loss was a pair of home runs by Austin Gallagher (Nos. 4 and 5), while Tommy Giles (No. 15) and Drew Locke (No. 7) also homered. Gallagher and Giles had three hits and three RBI apiece.