Oregon nearly doubled up Stanford in hits, but the Cardinal hit the three longest balls out of PK Park on Thursday night.

Second-ranked Stanford scored all of its runs on three homers to defeat Oregon 5-4 in front of 1,208. Brandon Wulff broke a 2-2 tie with his second home run of the game to start the top of the sixth inning and Duke Kinamon added a two-run shot later in the inning.

“They hit the ball over the fence and we got a lot of hits, but not that critical one,” Oregon coach George Horton said.

Sam Novitske had four of Oregon’s 13 hits as the Ducks batted .361 in the game while scoring single runs in the first, third, sixth and seventh innings.

“They got timely hits and killed us with home runs, but I thought we played well,” said Oregon shortstop Spencer Steer, who hit his sixth home run of the season. “We got a lot of hits and scored in a lot of different innings. We got a bunch of rallies going, so there is nothing to be frustrated about. We’ve got to come out and get the win tomorrow.”

Stanford (25-6) stayed on top of the Pac-12 baseball race at 11-2 while Oregon (22-14) remains tied for fifth at 7-6.

“We think we can compete with them and I like the mentality of where my team was,” Horton said. “Early on, they threw some blows and we were throwing blows and it went back and forth.”

Oregon took its only lead in the first inning when Novitske led off with a single and Tanner Smith walked before Jonny DeLuca hit a ground-rule double with two outs that scored Novitske. Smith would have scored as well if the ball had not bounced over the wall, but instead he was stranded at third when Aaron Zavala grounded out.

“That was a bad break on Jonny’s ball because it was going to be a second run,” Horton said. “When you play a team as capable as Stanford, you like to get all those breaks.”

Stanford answered in the top of the second when Andrew Daschbach doubled off UO starter Cullen Kafka and Wulff followed with a two-run homer. The Cardinal loaded the bases with one out in both the third and fourth innings before Kafka got a double play to end both scoreless frames.

Steer led off the bottom of the third with a solo homer to tie the game 2-2.

Wolff opened the top of the sixth with another home run to put Stanford up 3-2. Nick Bellafronto was hit by a pitch with two outs before Kinamon hit a two-run homer to stretch the lead to 5-2.

Kafka allowed seven hits and five earned runs in 5 2/3 while striking out five with four walks. Kolby Somers, Peyton Fuller and Ryne Nelson combined for 3 1/3 innings of hitless relief for the Ducks.

Stanford starter Brandon Beck gave up nine hits and two earned runs in five innings.

Beck left the game after giving up a leadoff double to Gabe Matthews in the bottom of the sixth. Jakob Goldfarb hit a two-out single that scored Matthews to get Oregon within 5-3.

Novitske got his fourth single in the seventh and went to second on an error. Smith singled him to third before Steer drove in Novitske on a fielders choice.