LOS ANGELES (AP) — After launching 10 home runs in their first two games against the Pirates, the Dodgers kept it in the park and still won their fourth in a row.

Rich Hill earned his first victory in three months, Yasmani Grandal and Chris Taylor drove in three runs apiece, and Los Angeles beat Pittsburgh 6-4 on Wednesday night to sweep the Pirates for the second straight year.

The Dodgers outscored the Pirates 31-8 in the series, the first time they’ve totaled 30-plus runs and 20-plus extra-base hits in a three-game series since 1950, when the Brooklyn Dodgers had 47 runs and 22 extra-base hits also against the Pirates, according to Stats LLC.

“It’s been fun. Everybody seems to be swinging the bat well,” Taylor said. “It seems like it’s a different guy every time. We know we can manufacture runs. It just happens we’ve been scoring most by the homer.”

Hill (2-3) allowed two runs and four hits in five innings for his first victory since April 1, when he won his season debut against the Giants. The left-hander, who had been sidelined by blister issues, struck out five and walked one.

It was the first time the Pirates walked in the series.

“The mechanical things we worked on a month ago I look forward to keeping the rest of the season,” Hill said.

Daniel Hudson, who relieved Hill, was ejected in the sixth by first-base umpire Jeff Nelson. Hudson gave up a one-out single to Elias Diaz and then appeared to be yelling in Nelson’s direction before getting tossed. Hudson gave a dismissive wave of his right arm before retreating to the dugout.

Dodgers manager Dave Roberts said Nelson had cautioned Hudson that his hand was carrying the ball, although Roberts said the delivery wasn’t out of the ordinary.

“He wanted Daniel to have the hand available for the runner to see,” Roberts said. “Nelly interpreted it correctly.”

Dodgers third baseman Justin Turner was hit by a pitch from Tyler Glasnow in the fifth, but stayed in the game. The ball grazed his shoulder first before striking part of his helmet.

“It kind of shook him up,” Roberts said.

Grandal gave the Dodgers a 1-0 lead with a two-out RBI single in the first. His two-run RBI double put them back in front in the third, and Taylor followed with an RBI single to chase Clay Holmes (0-1) and make it 4-2.

Pittsburgh lost its third in a row and went 4-5 on its nine-game trip to New York, San Diego and Los Angeles.

“The game shows you where you need to improve,” manager Clint Hurdle said. “It gives you immediate feedback.”

Holmes gave up four runs and five hits in 2 1/3 innings of his first major league start. The right-hander struck out two and walked three, all in the first inning when he needed 35 pitches.

“I made some good pitches,” Holmes said. “But they had some good takes and made me work a little extra in the first.”

TRAINER’S ROOM

Dodgers: RHP Walker Buehler (right rib microfracture) is set to throw a simulated game in Anaheim on Sunday. That session should end his rehab and he will return to the club. ... RHP Hyun-Jin Ryu (left groin strain) will go to spring training camp in Arizona while the Dodgers are on a seven-game trip to Anaheim and San Diego. Ryu will be joined there by RHP Pedro Baez (right biceps tendinitis), LHP Tony Cingrani (left shoulder strain) and RHP Josh Fields (right shoulder inflammation).

ADVENTURE IN BASE RUNNING

Hill notched his first hit of the season with a perfectly placed bunt single in the fourth and his first since Sept. 27, 2017. That launched his adventure on the base paths. He advanced to second and third on wild pitches. Hill slid home head-first only to get tossed out on a double-play ball by Max Muncy. “Sliding head-first into home plate for a pitcher is no-no,” Taylor said. Hill said he would get treatment on his neck. “I just need to learn how to slide feet-first,” he said.

UP NEXT

Pirates: Off on Thursday before RHP Trevor Williams (6-6, 4.22 ERA) starts at home Friday against Philadelphia. He has lost his last two starts.

Dodgers: After an off-day, RHP Kenta Maeda (5-5, 3.36) starts the series opener Friday in Anaheim. He is 1-1 with a 3.27 ERA in two career starts against the Angels.