SAN DIEGO (AP) -- Jacob deGrom took a perfect game into the sixth and allowed two hits over eight innings, leading the New York Mets to a 7-0 win over the San Diego Padres on Monday night.

New York Mets' Jacob deGrom throws against the San Diego Padres in the eighth inning (AP Photo/Lenny Ignelzi)

The lanky right-hander struck out the first four batters and did not allow a baserunner until Clint Barmes led off the sixth with single through the right side of the infield.

After striking out rookie Austin Hedges, deGrom (6-4) induced pinch-hitter Abraham Almonte to hit a grounder back to the mound, and deGrom started an inning-ending double play to shortstop Wilmer Flores.

Will Middlebrooks had the Padres' other hit - an infield single in the eighth - before Sean Gilmartin pitched the ninth to finish the two-hitter. DeGrom faced one batter over the minimum for eight innings.

DeGrom and Padres starter Andrew Cashner (2-8) combined to strike out eight straight batters from the last out in the top of the first through the first batter in the bottom of the second.

Daniel Murphy had four hits, including a two-run homer, and drove in three runs as the Mets snapped a seven-game road losing streak.

Ruben Tejada had three hits and scored twice. Darrell Ceciliani, Juan Lagares and Wilmer Flores each had an RBI single as New York amassed 13 hits.

Murphy hit his homer off Cashner in a four-run fifth inning.

DeGrom, who pitched into the eighth inning in three straight starts for the first time in his career, has allowed only three runs and struck out 34 over his last 29 1-3 innings while issuing one walk.

Cashner established a couple of career highs as he struck out 12 but also gave up 11 hits. The right-hander allowed six runs - five earned - over 4 2-3 innings.

TRAINER'S ROOM

Mets: Mets 1B Lucas Duda was out of the starting lineup after getting hit by a pitch in his right knee on Sunday. The team doesn't expect Duda to miss any extended time. ... The club is hoping to get an update, as early as Tuesday, on the progress of 3B David Wright (spinal stenosis). Wright has been receiving treatment in Los Angeles. ... Manager Terry Collins said there is no time table for C Travis d'Arnaud's return from a wrist injury.

Padres: 1B Yonder Alonso (right shoulder bruise) is expected to be activated off the 15-day DL on Tuesday, manager Bud Black said. . CF Wil Myers (left wrist tendinitis) did some sliding drills Tuesday and could take batting practice on Wednesday.

UP NEXT

Mets: RHP Noah Syndergaard saw his ERA drop more than one-half a run from 2.55 to 1.82 courtesy of a scoring change. Pittsburgh's Gregory Polanco was originally awarded a single on May 22 in the second inning when two runs scored. Major League Baseball changed the scoring decision to an error on Duda, making both runs unearned.

Padres: Ian Kennedy (2-5, 7.15 ERA) has lost four straight starts, allowing 20 runs on 24 hits over 19 1-3 innings for a 9.31 ERA.

(© 2015 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed)