In his most perplexing season, Braves veteran Julio Teheran had alternated really good and really bad starts his past six times out. But Sunday, in the last game before the All-Star break, when his slumping team needed a solid performance from the veteran to help send them to the break in a better mood, he came through.

Teheran had one of those days that remind folks of how good he still can be, taking a two-hit shutout to the seventh inning of a 5-1 sweep-averting win over the Diamondbacks at SunTrust Park.

“It was big for the team,” Teheran said after allowing four hits and three walks in 6-1/3 scoreless innings. “That’s the way we want to finish the first half. Obviously the last week we had a couple losses. (Sunday’s win was) the way we want to finish.”

It was one win in a 162-game season, but given the circumstances -- the recent slump, a potential sweep at hand entering the break -- it felt a lot more important than just another July win.

“That’s huge,” said Freddie Freeman, who had an RBI double in the four-run second inning and seemed rejuvenated as he prepared to catch a flight to Washington, D.C. for the Home Run Derby Monday and All-Star game Tuesday. “We needed that today. We obviously haven’t been playing the way we wanted to the last couple of weeks, so to end on a good note was big. (Teheran) pitched great and we were able to get him some run support.”

The Braves scored four in the third against All-Star Patrick Corbin and cruised to just their third win in 11 games and their fourth in the past 11 games at SunTrust. They’ve been drawing their largest home crowds in years but not playing lately like they did for the first three months.

On Sunday, they played like the team that held first place in the National League East for all but two days from May 2 until this homestand, when the Braves lost three of the first four and slipped to 1½ games behind Philadelphia. But the Braves (52-42) won Sunday, the Phillies (53-42) lost, and it’s just a half-game deficit entering the break.

“Lately I’m kind of grinding on every game,” Braves manager Brian Snitker said of the recent slump. “But I think back and at the end of March if somebody said you’d be 10 over .500 and half a game out of first (at the break), would you take that, and I wholeheartedly would’ve. I thought it was a really solid half. Guys did a lot of really good things. Young guys have taken some huge steps forward I think.”

Freeman, Teheran and Nick Markakis are among a small group of Braves who were around for the past three seasons of 90 or more losses and said it’s an entirely different feel in the clubhouse as they head to the break this time.

“We feel great, right where we need to be,” Freeman said. “It’s nice to have a winning record at the break; it’s been a few years. We’re right where we need to be, a half-game back. So get some rest and hope to come out with a bang.”

Markakis said, “I mean, 10 games up over .500 is definitely better than what we’ve had in the past. We’ve just got to take this break and recharge, come back out in the second half. We’ve got our hands full right off the bat with Washington and L.A. (Nationals and Dodgers in the first and third series after the break), so rest and look to come back in the second half and start strong.”

Teheran (7-6) had a two-hit shutout going before allowing a pair of hits in the seventh. He looked like a frontline starter: Crisp pitches, improved velocity, good location and a mix that kept the West-leading Diamondbacks off balance.

A snapshot of his performance came in the sixth when he struck out slugger Paul Goldschmidt on five pitches. Teheran started him with three 90-91 mph fastballs, got him to swing at a nasty slider for a 2-2 count and finished him with a 93-mph fastball that Goldschmidt swung through.

“That was probably the best I’ve seen Julio pitch this year,” Markakis said. “He was getting his off-speed stuff over early and he was locating really well, or at least that’s what it looked like from the outfield. Looked like he was putting the ball where he wanted to, getting a lot of swings and misses.”

The Braves gave him a big lead and Teheran protected it.

“It’s different pitching with the lead, especially if you get more than three runs,” he said. “It’s a different game, you don’t have to worry about mistakes. I was just going out there and throwing strikes and if they were swinging, I know I’ve got defense behind me and I wasn’t worried. When you’ve got the lead you’re able to do that.”

In their last two games before the All-Star break, the Braves faced a pair of All-Star pitchers. They couldn’t muster anything against Zach Greinke in Saturday’s 3-0 loss, but they jumped on Corbin in a four-run third inning, scoring as many runs in that inning as they had scored in the left-hander’s previous 38-2/3 career innings against the Braves.

Corbin entered Sunday with a 0.98 ERA in seven games (five starts) against the Braves, the lowest ERA against Atlanta for any starting pitcher with five or more starts. He fell out of the top five Sunday as it climbed to 1.69, leaving the unforgettable Dennis “Oil Can” Boyd (1.17) atop that list.

Dansby Swanson and Freeman each had RBI doubles in the inning and Ozzie Albies and Markakis had RBI singles, with Albies hustling to reach third base on his infield single when third baseman Jake Lamb’s throw to first base sailed high. Freeman doubled one out later.

Preston Tucker’s pinch-hit home run in the seventh off one-time Braves prospect Randall Delgado was just the third in nine games for the Braves and pushed their lead to 5-0. It was Tucker’s third career pinch-hit homer and first since 2015 when he was with the Astros. Tucker was recalled Friday from a long stint at Triple-A Gwinnett.

Dan Winkler gave up an eighth-inning homer to John Jay for Arizona’s only run.

For Teheran, the strong performance gave him a 3.28 ERA and .164 opponents’ average in his past six starts, with 42 strikeouts and 18 walks in 34-2/3 innings. Twelve of 13 runs he allowed in that stretch came in two starts, while he was 3-0 with a microscopic 0.36 ERA in the other four.

The only trouble Teheran encountered through six innings came in the third, when Daniel Descalso hit a leadoff double and Alex Avila walked to put two on with none out in a then-scoreless game.

Corbin followed by barely making contact with a ball that rolled to the left of the plate and was picked up quickly by Kurt Suzuki as it hit the chalk line of the batter’s box. Suzuki fired to Johan Camargo for the force at third. Camargo had plenty of time to throw across the diamond to first base for the double play as Corbin thought the ball was foul and didn’t immediately run hard.

That was the only time the Diamondbacks advanced a runner to second until the seventh inning, when Teheran gave up a leadoff single to A.J. Pollock on a grounder that got past Camargo. Teheran promptly picked off Pollock at first with a move that’s been as good as any by a major league right-handers for several years, but still catches plenty of runners seemingly unaware.

Lamb followed with a double and Ketel Marte walked before Snitker strode to the mound and replaced Teheran, who threw only 79 pitches including 50 strikes. Jesse Biddle induced a ground-out from Descalso and struck out Avila to keep Teheran’s line scoreless.

In his last two starts before the break, against the Blue jays and Diamondbacks, Teheran allowed just seven hits and one run in 13 innings, with six walks and 11 strikeouts. And both games were at SunTrust Park, the home field that has not been kind to Teheran for most of its first 1½ seasons.

“My mindset was just, do my job like I did my last start,” he said. “Everything was working. My slider, my command was on point. Good thing we got the lead; that was the beginning for us. I know the guys have been trying hard but it’s just been difficult to get the offense going. That third inning was big, for the team and for me.”