MIAMI — Rookie Luis Perdomo got 12 outs with six pitches, which took him a long way toward his first complete game, and the first this year for the San Diego Padres.

Perdomo benefited from a team record six double plays and needed only 99 pitches to throw a six-hitter Sunday, helping San Diego win the rubber game of their series against the sputtering Miami Marlins, 3-1.

Perdomo (7-7) allowed the leadoff batter to reach in five innings, and each time the runner was erased on a double play grounder. Padres manager Andy Green credited his 23-year-old right-hander’s rapidly improving sinker.

“He varies it in speed from 91 to 97 mph, and it has serious movement,” Green said. “He still hasn’t completely harnessed it yet. Sometimes it runs horizontally instead of diving, but he is getting closer and closer to understanding how to move it the way he wants.”

The most novel DP came in the seventh inning, when Perdomo gave up a one-out single before Ichiro Suzuki lined out to the pitcher, who trotted to first base to double off the runner.

“A little bit of luck in there,” Miami manager Don Mattingly said. “There were some balls that were hit firm.”

Five Marlins hit into double plays, and they went 6-4-3, 4-6-3, 6-4-3, 6-3, 1, and 5-4-3. The six DPs were a nine-inning team record for the Padres defensively, and a Marlins batting record.

Perdomo lowered his ERA from 6.24 to 5.84 and beat Miami for the second time this year.

“He commanded his sinker well and got us to ground out,” said the Marlins’ Dee Gordon, who was erased twice on the bases by double plays and hit into a DP. “Hats off to him. He pitched a great game and kept us off balance.”

Perdomo walked three, struck out three and retired the final five batters in order for the Padres’ first complete game since Tyson Ross threw one June 20, 2015. He didn’t realize until after the game that the Padres had turned six double plays.

“It was a big help,” the Dominican said in Spanish.

Ryan Schimpf hit an RBI triple, singled and scored for the Padres and finished 7 for 10 in the series.

The Marlins hurt their wild-card chances by going 2-4 on their homestand while scoring only 13 runs. Seeking their first playoff berth since 2003, they begin a seven-game trip Monday at the Mets.

“As bad as it looks right now in this storm we’re in, it’s still doable,” Mattingly said. “We’ve got to grow up, have an approach and be ready to play Monday. We can’t go into New York dragging our heads. We have to continue to play. These are things we’re going to learn about this club. If we’re going to move forward as an organization, these are the things we have to do.”

Justin Nicolino (2-6) allowed three runs in six innings in his first start since July 6. He was called up from Triple-A to replace Andrew Cashner, who was scratched because of a finger blister.

The Padres rallied from a 1-0 deficit with two runs in the fourth. Alex Dickerson, a late entry in the lineup when Wil Myers was scratched because of a stomach virus, doubled to start the comeback. Schimpf tripled off the center field wall, and Luis Sardinas hit a two-out RBI double.

Schimpf scored in the sixth when he was hit by a pitch, took second on a wild pitch and came home on a two-out single by Adam Rosales.

Doubles by J.T. Realmuto and Xavier Scruggs in the second scored the Marlins’ run.

TRAINER’S ROOM

SS Sardinas rolled his left wrist diving for a hit in the seventh. He stayed in the game after consulting with a trainer.

“I had a little scare, but I’m OK,” he said.

UP NEXT

Marlins: RHP Jose Fernandez (13-7, 2.91) is scheduled to start Monday at the Mets against RHP Rafael Montero (0-0, 11.57) to begin a four-game series. Fernandez is 3-5 with a 4.42 ERA on the road this year, but he’s 3-0 with a 1.54 ERA in seven career starts against the Mets.

Padres: RHP Edwin Jackson (3-4, 5.71) is scheduled to start when San Diego opens a three-game series Tuesday at Atlanta.