DETROIT (AP) — Nick Castellanos arrived at third base, clapped his hands joyously and bent over to slap the dirt.
Finally, the Detroit Tigers had broken through for a big inning.
"I've been waiting for that all season," Castellanos said. "I needed it, the team needed it, the organization, the fans needed it. Everybody needed it."
Castellanos hit a bases-loaded triple with two out in the eighth inning to lift Detroit to a 5-2 victory over the Milwaukee Brewers on Wednesday night.
The Tigers avoided a sweep in the three-game series thanks to a rally in their final at-bat. They had scored only three runs in the first two games against Milwaukee.
With two out, nobody on and the score tied at 2, Jonathan Broxton (1-1) allowed consecutive singles by J.D. Martinez and Yoenis Cespedes and a walk to Tyler Collins.
Castellanos' line drive down the line dropped in, then skipped past right fielder Gerardo Parra to clear the bases.
"I got two quick outs and then I didn't get myself out of the inning," Broxton said. "That's always frustrating, especially when I thought I was making good pitches. I have to be able to end that inning."
It was the third triple of the season for Castellanos, who raised his average to .240.
Blaine Hardy (2-0) struck out the only batter he faced for the win, and Joakim Soria pitched the ninth for his 13th save in 13 chances.
Ryan Braun homered for the Brewers.
Cespedes had three hits and a walk. He led off the second with a double, then stole third and scored when catcher Martin Maldonado threw wildly to third for an error.
Braun tied it at 1 in the fourth with his 10th home run of the season. He's hit nine in his past 21 games, and that solo shot gave Braun 790 RBIs for the Brewers, pulling him even with Paul Molitor for third on the team's career list.
Martinez led off the bottom of the fourth with a single, extending his hitting streak to 11 games. Cespedes and Collins followed with singles, and Martinez scored on a groundball by Castellanos.
The Brewers tied it in the seventh on Elian Herrera's RBI double, but with one out, Luis Sardinas was held up at third on the play. Maldonado followed with a lineout to the shortstop, and Sardinas, who had started for home, was easily doubled off.
"That's just bad luck," Diamondbacks manager Craig Counsell said. "Sardy is going on contact, and Maldy hit the ball hard. That's what you want with a drawn-in infield, but he hits it right at someone."
James McCann, Detroit's No. 1 catcher now that Alex Avila is injured, made a nice catch of a foul popup against the netting behind the plate. He also threw Carlos Gomez out stealing.
"The longer you play in a stadium, the more used to the netting you get," said Tigers manager Brad Ausmus, himself a former catcher. "He certainly hasn't played at Comerica (Park) very much. Every out seems to be big for us right now, so it was a big play."
Detroit's Shane Greene allowed two runs and three hits in 6 1-3 innings. He struck out six and walked two.
Milwaukee's Kyle Lohse gave up two runs and seven hits in six innings.
Brewers: Gomez, who was hit in the head by a pitch Sunday, took one off the right arm Wednesday. There was a delay while Gomez was checked, but he remained in the game.
Tigers: Reliever Bruce Rondon (bicipital tendinitis) begins a rehab assignment Thursday with Triple-A Toledo.
The Tigers host AL West-leading Houston on Thursday. David Price (3-1) takes the mound for Detroit against Scott Feldman (3-4) of the Astros.
Milwaukee plays at Atlanta on Thursday night. Matt Garza (2-5) of the Brewers faces Julio Teheran (3-1) of the Braves.