Julio Teheran didn’t pitch a perfect game against the Phillies on Sunday. He did pitch an excellent game, continuing a late-season trend that gives the Braves hope he’ll be a front-line starter again in 2016.

Teheran was perfect against the Phillies until second baseman Freddy Galvis ended the bid with a single to lead off the seventh. Teheran had to settle for a no decision as the Phillies tied the game in the ninth inning before the Braves went on to win 2-1 on A.J. Pierzynski’s RBI single in the bottom of the ninth.

Teheran has regained the form that earned him his first All-Star selection in 2014. The Braves declared Teheran their unquestioned ace coming into this season but he was inconsistent and occasionally ineffective for the first half.

Teheran has been much better in the second half. In 12 of his past 15 outings including Sunday, Teheran delivered quality starts with no more than three earned runs allowed and at least six innings pitched. He held the Phillies to five singles over 8 1/3 innings.

“I am feeling confident,” Teheran said. “I feel like I’m at my best right now. I feel like I’ve got all of my stuff together. I’m competing. You can see whenever I step on the mound, everything is working. Sometimes I make a mistake but that’s normal because we are all human and make mistakes. I stay just stay focused and don’t’ make any more mistakes.”

Teheran’s day was over after he allowed back-to-back, one-out singles to Aaron Altherr and Brian Bogusevic in the ninth. Peter Moylan replaced Teheran and gave up a two-out, run-scoring single to Andres Blanco that tied the game at 1-1.

Moylan retired Darin Ruf to end the inning. Braves shortstop Andrelton Simmons set the plate for Pierzynski’s game-winning hit against relief pitcher Luis Garcia (3-6).

With one out Simmons hit a high chopper off of the plate for an infield single, and then advanced to second on a throwing error by third baseman Cody Asche. Simmons stole third base with Jace Peterson at the plate, and Peterson walked to bring up Pierzynski.

Pierzynski poked Garcia’s second pitch to left center field over the Phillies infielders playing shallow.

“You know if you get it to the outfield there’s a pretty good chance it will either fall or he can score (on a sacrifice fly),” Pierzynski said. “It worked out.”

The Braves (60-90) earned their first three-game sweep since they did it to the Mets June 19-21.

Teheran struck out six batters while allowing no hits and no walks through six innings. Galvis ended the streak when he swung at Teheran’s first-pitch fastball and knocked it cleanly through the middle of the infield.

Teheran said he’s never taken a perfect game that deep but didn’t think much about it.

“That’s something you don’t want to put in your mind,” he said. “I was just trying to make pitches like I was doing. (Galvis) got a pretty good pitch and he hit it.”

Teheran batted to begin the bottom of the eighth, meaning he’d get a chance for the shutout. After was pulled in favor of Moylan, Braves fans gave Teheran an ovation as he walked to the dugout and he tipped his cap in acknowledgement.

Moylan retired Jeff Francoeur before Blanco singled to Todd Cunningham in shallow right field. Cunningham’s throw home was off line and catcher Christian Bethancourt’s tag attempt was too late to get Altherr.

Bethancourt left the game with a hand injury that he suffered on the play. he was replaced by Pierzynski, who abandoned his leisurely day of watching NFL games in the clubhouse.

“Right off the couch, pretty much, and right into the game,” Pierzynski said. “It’s fun.”