PHOENIX -- After 1,090 games, Hanley Ramirez is in the postseason after personally escorting the Los Angeles Dodgers to the National League West title on Thursday.
Ramirez had two home runs and four RBIs and A.J. Ellis hit a tiebreaking homer in the eighth inning to give the Dodgers a 7-6 victory over the Arizona Diamondbacks.
"I want to keep going. There are a couple of more steps to take," Ramirez said when asked what securing the division title meant.
"For the team, it is an unbelievable feeling. It gives you more energy and a new attitude to keep going and finish it."
Ramirez hit a three-run homer for a 3-0 lead in the third inning and his bases-empty home run leading off the seventh tied the score at 6. He also had two singles to raise his batting average to .351, and he has 20 homers while playing only 81 games in an injury-plagued season.
"This is one of the best hitters in baseball," Dodgers manager Don Mattingly said. "He can really, really hit. I told him I want the whole world to see him hit."
Ellis hit the first pitch he saw from Josh Collmenter (4-4) leading off the eighth as the Dodgers (88-65) became only the fourth team in major league history to finish a season in first place after being in last place on July 1 or later.
The Dodgers were 38-43 and in fifth place, 3 1/2 games behind the Diamondbacks on July 1, but took command of the division with a 53-13 run that began the final week of June. The only other teams to pull off a midseason worst to first are Seattle (1995), the
New York Mets (1973) and the Boston Braves (1914), according to Elias.
The Dodgers are the second team in as many seasons to win a division after trailing by as many as 9 1/2 games. Oakland trailed Texas by 9 1/2 before winning the American League West last year.
"Even though you couldn't really see the light, you knew it was out there," Mattingly said. "It was pretty foggy, right, but we were able to stick to it and keep heading in the right direction. Then the boys took off."
J.P. Howell (3-1) got the final two outs of the seventh inning for the victory and Kenley Jansen pitched the ninth for his 26th save.
Ellis had three hits, and the homer was his eighth of the year.
"They had a great second half," Arizona manager Kirk Gibson said. "Where they come from was impressive. I like to think we made them better during the process."
Martin Prado had two hits and two RBIs for the Diamondbacks (77-75), who had won four of their last five.
"Maybe this year it is them. Maybe next year it is us," Prado said. "We didn't execute the way we should but sometimes you learn from your mistakes."
Paul Goldschmidt had a run-scoring double for his NL-leading 119th RBI and starting pitcher Wade Miley contributed a two-run double.
"We were in first place for a long time and let it slip away. To watch them do that it is hard to swallow," Miley said of the Dodgers' on-field celebration.
Ramirez hit his three-run homer after Miley walked Rick Nolasco and Yasiel Puig to open the third inning. Puig was forced at second base when he did not get a good jump on Jerry Hairston Jr.'s looping hit down the first field line.
The Diamondbacks scored six runs and had seven hits against Nolasco for a 6-3 lead in the bottom of the third.
After leadoff singles by Adam Eaton and A.J. Pollock, Goldschmidt hit a ground-rule double down the right field line before Prado tripled down the right-field line to tie it at 3. Miguel Montero singled in Prado with one out and Miley doubled in the final two runs of the inning after a Didi Gregorius double.
NOTES: Ramirez, who had been bothered by a back issue, left the game after grounding out in the top of the ninth inning. "Stan (trainer Conte) told me if I see him bend or shake, he is coming out. and it looked like he was doing some stuff, so I took him out," Mattingly said. ... Dodgers 1B Adrian Gonzalez (quadriceps) was held out of the starting lineup before entering the game for defensive purposes in the ninth inning. "For me, it's more than a cramp, but it's less than a full-blown injury. But it is enough to sit him," Mattingly said. ... Dodgers OF Andre Ethier (ankle) expects to take batting practice in San Diego on Friday. He has not played since tweaking the ankle while running the bases last Friday. ... Dodgers RHP Edinson Volquez will start at San Diego on Friday, his first start against the Padres since being released by them on Aug. 27.