Beck sailed along into the sixth and then allowed three of his five hits, including a two-run homer that brought the Aggies within 3-2. Relievers John Henry Styles, Zach Grech and Jack Little, who recorded his second save in as many days, kept UC Davis off the scoreboard the rest of the way.

"These midweek games are always a true test, especially coming off a big three-game series at home against a ranked opponent," Stanford coach David Esquer said. "Pitching and defense are what this team is built around, and that was on display again today with Nico (Hoerner), Maverick (Handley) and Beau (Branton) coming through with big plays down the stretch."

Nico Hoerner collected two hits, his third multi-hit game, for the Cardinal (4-0), which returns home to open a four-game series with Rice on Thursday at 6 p.m. Tim Tawa drove in a run.

Brendan Beck carried a shutout into the sixth inning and settled for a five-hitter over 5 2/3 innings to earn a victory in his collegiate debut as No. 12 Stanford won its fourth straight, beating host UC Davis 3-2 on Monday.

Handley, who entered the game in the seventh, caught an Aggie trying to steal second and Grech produced a third out to escape the jam.

In the eighth, the Aggies had a runner on third with no outs but Hoerner threw out the lead runner at home on the next play.

Tim Tawa continued his strong start, singling home Sacred Heart Prep grad Andrew Daschbach, who had walked, with two outs in the fourth to make it 2-0. Tawa scored to make it 3-0 after Bryce Carter reached on an error.

Hoerner led off the top of the first with a single up the middle, eventually scoring on a heads-up play after Brandon Wulff's infield single.

"We really needed a lot from Brendan today and he gave us just that," said Esquer. "He realistically made one real mistake and it was late in his outing, so we were overall very pleased with him."

McGarry allowed a run on two hits. He struck out one and did not walk a batter.

Menlo School grad Griff McGarry made his collegiate debut with Virginia, pitching the eighth inning of the Cavaliers 6-3 loss to Central Florida over the weekend.

Little struck out two of three batters in the final frame to earn the save, Stanford's third in four games.

Follow Palo Alto Online and the Palo Alto Weekly on Twitter @paloaltoweekly , Facebook and on Instagram @paloaltoonline for breaking news, local events, photos, videos and more.

Stanford baseball wins fourth straight to open the season

Starter Brendan Beck took a shutout into the sixth and settled for a five-hitter over 5 2/3 innings