SAN FRANCISCO — Andy Green pulled aside his Padres hitters before this series against San Francisco and challenged them to be better — in day and night games alike.

He had no complaints after San Diego’s rare sweep at AT&T Park that put a damper on the Giants’ plans of pulling closer to the division-leading Los Angeles Dodgers.

The Padres denied Madison Bumgarner a chance at his milestone 100th career win and the Giants wasted another chance for a potential push in the NL West, losing to the San Diego Padres 3-1 on Wednesday to be swept by the division’s second-to-last-place club.

“They really responded in this series,” Green said. “We’re still a long way from where we need to be but we’re getting closer, and that’s all you can ask.”

San Francisco missed more chances.

The division-leading Los Angeles Dodgers beat the New York Yankees later Wednesday, increasing their division lead to five games. On Tuesday night, the Giants’ bullpen blew a three-run lead in the ninth and the Giants failed to gain ground.

Now, they must regroup to host St. Louis for an important four-game set starting Thursday night among playoff contenders and wild-card candidates. San Francisco has won the World Series in every even year this decade: 2010, ’12 and ’14.

“There’s a lot of pressure this time of year,” Bumgarner said. “It’s more of a mindset this time of year.”

Luis Perdomo (8-9) allowed one run in 6 1/3 innings of four-hit ball. He struck out five with one walk. The 23-year-old right-hander who the Padres acquired in the Rule 5 draft from the Cardinals has given up three runs or fewer in 11 of his last 15 starts.

Perdomo knows that hanging tough with Bumgarner (14-9) shows how far he has come.

“I think so. He’s been in the big leagues for some time now and he’s a beast,” Perdomo said through a translator.

Brandon Maurer finished for his 10th save.

Trailing 3-1 in the bottom of the eighth, San Francisco’s Denard Span was picked off trying to get back to first after drawing a two-out walk.

Span’s base-running blunder was the Giants’ second on the day. Brandon Belt was doubled up at second base in the bottom of the second on Conor Gillaspie’s liner to first.

Bumgarner, the 2014 World Series MVP, allowed seven hits and three runs, all earned, with five strikeouts and two walks in 6 2/3 innings.

When he takes his next turn, the lefty again would try to become the third-youngest Giants pitcher reach 100 victories.

Luis Sardinas had an RBI single among his three hits for San Diego, while Wil Myers added a double.

The Giants lost their sixth straight to San Diego — outscored 29-15 — after winning the initial nine matchups of 2016.

San Francisco was swept by the Padres for the second time this season, after dropping three in a row at Petco Park to begin the second half. San Diego earned its first sweep at AT&T Park since May 2010.

“It’s not this big macro statement about where we are in the season and what we’re trying to accomplish,” Green said. “It’s not playing spoiler or anything like that.”

POSEY’S PLEDGE

Before the game, Giants catcher Buster Posey and ESPN basketball analyst Dick Vitale teamed up to discuss their pledge to raise awareness and money for pediatric cancer research. Posey and wife Kristen were set to host a benefit at the ballpark for The V Foundation’s Buster and Kristen Posey Pediatric Cancer Research Award.

TRAINER’S ROOM

Padres: RHP Jarred Cosart (hamstring, groin) still is in the plans to start Sunday’s series finale at Colorado or by Monday at home against Arizona at the latest.

Giants: 1B Brandon Belt returned from an illness that kept him out Tuesday night. … RHP Derek Law was activated from the 15-day disabled list on his 26th birthday after he missed 15 games with a strained right elbow.

UP NEXT

Padres: LHP Christian Friedrich (5-10, 4.67) will pitch the series opener in Colorado on Friday. Friedrich’s most recent start was arguably his best this year. He struck out a season-high 10 batters and allowed one walk in seven shutout innings of two-hit ball against the Rockies.

Giants: RHP Johnny Cueto (15-5, 2.90) starts the opener of a four-game series against St. Louis. Cueto is 2-2 with a 2.56 ERA over his last five starts. He’s 6-8 with a 3.88 ERA in 21 career starts against the Cardinals.