James Paxton and three relievers combined on a three-hitter, Aaron Judge continued his tear by hitting a two-run homer in the sixth inning, and the New York Yankees ended their nine-game West Coast road trip with a 7-3 victory over the Seattle Mariners on Wednesday afternoon.

The Yankees, who hit four homers Wednesday, ended their trip at 5-4. They won the final four games and five of the last six after starting the trip with three straight losses in Oakland last week.

Paxton (11-6) started against the Mariners for the first time since being dealt from Seattle to New York in November, and he won his sixth consecutive start. In five innings, he allowed just one hit and two runs, both on Kyle Seager’s with two outs in the fourth.

Paxton struck out four, walked five and threw 86 pitches. Chad Green pitched two hitless innings, Adam Ottavino ended the eighth by getting a double play, and Cory Gearrin finished up in the ninth after allowing two hits, including an RBI single by Dylan Moore.

Paxton sailed through three hitless innings before losing the strike zone in the fourth.

He allowed four walks plus Seager’s homer over the right-center-field fence on a 1-0 cutter.

After Seager’s 18th homer, Paxton issued four-pitch walks to Tom Murphy and Daniel Vogelbach sandwiched around a wild pitch.

Paxton kept the game tied by getting Moore on a lineout to center field on the first pitch.

Judge hit his fifth homer in six games and sixth on the trip when he drove a 2-2 slider from Matt Wisler into the left field seats to put New York up 6-2 in the fifth inniing.

Gary Sanchez reached 30 homers for the second time in his career with a two-run homer in the first inning off Justus Sheffield (0-1).

New York rookie Mike Ford hit a tiebreaking solo homer to lead off the fifth. Later in the inning, DJ LeMahieu added an RBI single that knocked out Sheffield before Judge hit his 18th homer.

LeMahieu also hit a solo homer in the ninth as the Yankees ended the trip with 18 homers in the last six games.

New York also became the eighth team to hit at least 250 homers in a season. a list that also includes the 2019 Minnesota Twins.

Sheffield, who was dealt by the Yankees for Paxton, allowed five runs on six hits in 4 1/3 innings in his second career start.

He struck out five, walked none and retired nine straight before Ford went deep.