After grounding out with the bases loaded to end the sixth inning Friday, the Braves’ Eury Perez didn’t have to wait long for a shot a redemption. And he made the most of it.

Perez hit a two-run, two-out single with the bases loaded in the eighth, lifting the Braves to a 4-2 win against the Cubs in the opener of a three-game series at Turner Field. The Cubs’ Pedro Strop had walked A.J. Pierzynski intentionally with two out and first base open, then walked Andrelton Simmons unintentionally to load the bases.

Perez hit the first pitch to right field, a tie-breaking hit that allowed the Braves to snap a five-game losing streak and thrilled most of those in a crowd of 42,532 in the first game after the All-Star break.

“Huge,” Braves first baseman Kelly Johnson said. “That’s awesome. We need everybody to step up. We need anybody and everybody. To get in that situation with two outs and drive in two, it’s huge.”

With the score tied in the sixth, the Braves loaded the bases on an error, a two-out single by Pierzynski and a Simmons walk, but Perez’s groundout to short ended the threat. He couldn’t have known he’d get another chance, but he did two innings later.

“He’s been swinging the bat well since he’s been up here,” Braves manager Fredi Gonzalez said. “Big at-bat in that situation, and you feel good that he was going to put the ball in play. Obviously you didn’t know he was going to get two-out, game-winning RBIs.”

After Julio Teheran was pulled in the fifth inning, five Braves relievers combined for 4 1/3 scoreless innings of two-hit ball, with Jim Johnson pitching a perfect ninth for his sixth save and first since moving into the closer role after Jason Grilli’s season-ending Achilles injury last weekend.

The Braves are 12-2 in their past 14 games against the Cubs, including 8-0 at Turner Field.

Until Perez’s hit, the Braves were 1-for-7 with runners in scoring position, that hit a two-out single by Johnson in the first inning that staked Teheran to a 1-0 lead.

Teheran has been just as good at Turner Field this year as he’s been bad on the road, which is “very” in both cases. But in the first game after the All-Star break, the Braves’ former All-Star wasn’t left in long enough to get a decision.

Teheran was pulled with two on and two out in the fifth, and Braves newcomer Ross Detwiler got the last out of the inning to leave Teheran with this final line: 4 2/3 innings, five hits, two runs, three walks and five strikeouts in 90 pitches (54 strikes).

“I’m not going to lie, I was surprised, because I was competing right there,” Teheran said. “That’s all I can do. When I got in trouble like I did in the first inning, I competed. Just one mistake that I made, and you know how this game is, you pay for it. I was really focused on this game, on what I was doing. I was surprised a little bit (to be pulled in the fifth), but what can I do?”

It was his shortest home start of the season for Teheran, who had been 5-0 with a 2.04 ERA in eight home starts before Friday, compared to 1-4 with a 6.95 ERA in 10 road starts. He was 4-0 with a 1.74 ERA and .159 opponents’ average in his past six home starts, lasting at least seven innings in each of his past five before the early exit against the Cubs.

With the score 2-2 in the fifth, Teheran gave up a leadoff infield hit before inducing a double-play grounder by Dexter Fowler. Then he got ahead in the count 1-2 against Kyle Schwarber before giving up a double on a 2-2 slider.

Next up was Kris Bryant, whom Teheran struck out in each of his first two plate appearances with runners on the corners and less than two out. This time, he walked him on six pitches. And that was all for Teheran, who was clearly displeased after handing the ball to manager Gonzalez and walking off the field, pulled after throwing 90 pitches (54 strikes).

Gonzalez didn’t want Teheran to face the left-handed hitting Anthony Rizzo, who had lined out in the first and walked to load the bases in the third, before Jorge Soler’s two-run single.

“There’s nothing that I was watching that made me feel good about that at-bat right there,” Gonzalez said of replacing Teheran with Rizzo up. “It’s tough. Here’s your starter (not) going five innings, but 4 2/3 with (runners on) first and second and Rizzo at the plate — it was one of those situations where you’ve got to make a decision and it worked well for us.”

Left-hander Detwiler, who just signed with the Braves on Friday, retired the left-handed hitting Anthony Rizzo on a grounder to end the inning. Detwiler was the 50th player used by the Braves this season, the most in the majors and already equaling a franchise record set when the Braves used 50 during the 2007 season.

The Braves staked Teheran to a 1-0 lead in the first inning. Nick Markakis stole second with two out and went to third on catcher Schwarber’s throwing error on the play. Johnson followed by working the count full and hitting an RBI single.

They had taken advantage of a Cubs mistake, after the Cubs failed to capitalize on a golden scoring opportunity in the top of the first. Dexter Fowler reached on a fielding error by first baseman Johnson on the first pitch of the game, and Schwarber followed with a single to put runners on the corners with none out.

Teheran then worked out of the jam by striking out Bryant, retiring Rizzo on a line-out to second and Jorge Soler on a pop-up to third. He got out of a runners-on-the-corners, no-outs jam, but couldn’t pull off a similar escape in the third.

The Braves tied the score in the third when Cameron Maybin drew a two-out walk and raced around to score on Markakis’ double to right.