LOS ANGELES — Playing to get closer to the postseason, the Padres went backward on Tuesday.

Even before they found out the Diamondbacks had completed a victory in Colorado, things had fallen apart at Dodger Stadium, as the starting pitcher the Padres had lined up to get them into the playoffs or start them off right in the playoffs got shelled.

A day that began with a chance to clinch a postseason berth became a cause for concern after the Dodgers scored four runs off Michael King in the second inning en route to a 7-0 victory.

Their first loss in six games left the Padres’ magic number at two with five games remaining in the regular season.

That means any combination of their victories and Diamondbacks losses that add up to two would clinch a playoff berth for a third consecutive season.

“Didn’t start very good for us,” Ty France said. “… There’s a lot left to play for these next five games, so just forget about it and worry about tomorrow.”

Padres manager Craig Stammen indicated before the game the Padres went into Tuesday taking nothing for granted despite having won 13 of 14 and having a five-game cushion with six to play.

“There’s work to be done,” Stammen said Tuesday afternoon. “So we’ve got to stick to our game plan, playing our standard of baseball. We can’t get too high or too low with it and try to look what’s ahead. We’ve got to stay in the moment and be where our feet are. And it’s good that we’re playing such a great opponent like the Dodgers, that if we aren’t doing that, they’re going to take advantage of us.”

That is precisely what happened.

The Padres had five hits against the eight pitchers who worked for the Dodgers while their starting pitcher yielded a lot of runs early.

King retired the first five batters he faced before a pair of two-out singles in the second inning and three consecutive walks got the Dodgers their first two runs, and Freddie Freeman’s single grounded through the left side doubled that lead to 4-0.

The Dodgers added another run in the fourth inning (King’s final inning) when Mookie Betts doubled and Freeman singled with two outs.

The hope was that King was on the mound for the last time in the regular season.

He was moved up a day, swapping places with Robbie Ray, so he would be available to start the regular season finale Sunday against the Diamondbacks if that game is a must-win for the Padres to get in the postseason.

Stammen said definitively on Tuesday that King would not pitch if all that was on the line was hosting a wild-card series.

While it would require playing much better than Tuesday, it remains a possibility the Padres could jump into the fourth seed and host a best-of-three series in the first round.

The three teams holding National League wild-card spots all have the same 87-70 record, though the Padres technically dropped to the No.6 seed because they lost the season series to the Cubs and Phillies.

“We’d like him to start Game 1 of the playoffs, no matter where it’s at,” Stammen said. “… It’s not a guarantee when you play at home that you win the series, and I think it’s more of a guarantee when you have your best pitcher pitching in the playoffs. So, I think it’s a relatively easy decision.”

That remains so even after King had his worst outing since he last faced the Dodgers and allowed four runs in 4⅓ innings on June 28 at Petco Park.

He held them to two runs over six innings in his next start, July 2 at Dodger Stadium and had a 2.62 ERA in six career regular season starts against the Dodgers going into Tuesday.

“Obviously, today sucked,” said King, who entered Tuesday’s game having made eight consecutive quality starts, a stretch in which he had a 1.95 ERA. “Still got a lot of confidence. I’ll make the right adjustments and be ready to go in my next one.”

The Padres did not mount much of a fight playing an opponent with a winning record for the first time in two weeks.

The Dodgers, who last week won their 13th NL West title in 14 years and are trying to lock down a first-round bye, used a parade of relievers to limit the Padres to two at-bats with runners in scoring position.

Those came in the second and fourth innings with two outs, and Jake Cronenworth made the final out both times.

“The Dodgers bullpen has got some good arms in it,” Stammen said. “And they’re bringing out guys that have really good stuff. But the best way to do it is to play a little small ball and try to beat them that way. We just didn’t have the opportunity to play that way and score one run at a time (after) we get down 4-0. That kind of eliminates that way of playing baseball.”