SAN DIEGO — Matt Harvey looked like himself again, Antonio Bastardo wiggled out of a late jam and the Mets took a 4-3 win over the Padres on Sunday, vaulting into first place for the first time this season.

“It’s only May,” manager Terry Collins said shortly after the Mets nudged a half-game ahead of the Nationals in the NL East. “We’ve got a long way to go.”

The finish line is nowhere close, but the Mets have looked the part of preseason favorites hoping to make good on heavy expectations.

StoryWright goes back to playing it safeStoryHall calls on Colon after first-ever homer

The Mets got a pair of run-scoring singles from Asdrubal Cabrera and another from Eric Campbell. Yoenis Cespedes belted his 11th home run, his third of the series. “I’m being a little more selective at home plate,” he said through a translator. “And it’s allowed me to hit more home runs.”

Harvey pitched like an ace, breaking from what had been a cycle of frustration. He held the Padres to two runs in six innings and finished with a season-high 10 strikeouts. It was the 11th double-digit-strikeout game of Harvey’s career but only his first in six starts this season.

“I finally felt, the majority of the game, a lot more comfortable,” said Harvey, whose command was noticeably sharper. “I was able to pound the zone, able to throw all my pitches.”

advertisement | advertise on newsday

Harvey entered with a 2-4 record and a 4.76 ERA, pedestrian numbers that he chalked up to an ongoing battle with his own pitching mechanics. That inconsistency led to spotty command despite velocity that has been on the upswing.

But aside from a two-run homer by Christian Bethancourt in the fifth that brought the Padres to within one run, Harvey hit his spots. “It’s the best command I’ve seen him have this year,” Collins said.

Harvey was helped by what appeared to be a break for the Mets in the fifth. The Padres lost out on the potential tying run when starting pitcher Andrew Cashner was thrown out at the plate while trying to score on Jon Jay’s double.

Mets videos

On replays, Cashner appeared to sneak his hand past Kevin Plawecki to touch the plate. The Padres challenged the call but it was upheld, and Harvey departed with the lead.

Jeurys Familia worked a perfect ninth and improved to 10-for-10 in save chances. But bridging the gap proved treacherous for the Mets, who burned through three relievers before needing some magic.

Jim Henderson balked home a run in the seventh. With a one-run lead to protect in the eighth, lefty specialist Jerry Blevins allowed a leadoff single by Jay. Setup man Addison Reed followed by giving up a broken-bat infield single to Wil Myers and a soft single to left by Matt Kemp.

Suddenly, the Padres had loaded the bases with no one out, prompting Collins to summon the lefthanded Bastardo. He whiffed pinch hitter Derek Norris and got Melvin Upton Jr. to pop up, leaving Alexei Ramirez as the final obstacle in the way of a much-needed reprieve.

Bastardo quickly got ahead 0-and-2 before Ramirez fouled two pitches into the screen and another into the stands. Plawecki signaled for an elevated fastball. Ramirez could only tip the 90-mph offering into the glove of Plawecki, who pumped his fist as the Mets jogged off the field.

advertisement | advertise on newsday

“I’m just trying to throw every pitch with intensity,” said Bastardo, who threw nothing but fastballs.

For the first time this season, the Mets (19-11) find themselves where they ended last regular season, in the driver’s seat in the NL East. The Nationals (19-12) relinquished their lead earlier in the day when they took the final loss in a four-game sweep by the surging Cubs.