Williams Perez kept extended innings with two outs, making for potentially trying circumstances against a potent Padres lineup. Perez got through those moments unscathed only to have some defensive lapses lead to a run.

Yet Perez never panicked. He calmly made pitches to get out of the potential jams of his own making and shook off the unearned run to finish seven strong innings and lead the Braves to a 4-1 victory Wednesday night at Turner Field.

Perez, a 24-year old rookie, looked like a pitcher long accustomed to working around the inevitable slip-ups against a big-league lineup.

“This guy has got some moxie,” Braves manager Fredi Gonzalez said. “He’s got some composure. He doesn’t rattle. He makes pitches. That’s tough to teach. That’s something that he’s got a confidence about him.”

Perez allowed no earned runs and left with a 3-1 lead. The Braves held it with scoreless innings by relief pitchers Brandon Cunniff and Jim Johnson.

The Braves (29-30) are two games behind first-place Washington (21-28) in the NL East.

The Braves’ offense backed Perez with 14 hits, with Perez providing a single. Outfielders Kelly Johnson (three hits and an RBI), Cameron Maybin (two hits and an RBI) and Nick Markakis (two hits, a walk and a run scored) provided some punch.

“Offense did the same thing we’ve been doing, and that’s competing at the plate, putting at-bats together and capitalizing when we get runners in scoring position,” Maybin said.

In his last start, Perez made it through just five innings against the Pirates as he extended innings with five walks. He left the Braves with a one-run deficit in that game after giving up a three-run homer in his final inning pitched.

This time Perez walked just two batters over seven innings. He issued a two-out walk to Justin Upton in the first inning and gave up a two-out single to Alexi Amarista but got the next batter out both times.

Perez loaded the bases with two outs in the third inning by hitting Upton with a pitch and walking Yonder Alonso. Will Middlebrooks flew out to center for the third out.

“There was a lot of good moments for him to learn and to experience,” Gonzalez said. “Those first three innings getting two quick outs and then a (base runner), that’s just inexperience. You let your guard down because you got the first two guys out and, all of a sudden, here we go. It was good. He gave us a great opportunity to win the ball game and we converted.”

The Padres scored their only run against Perez because of defensive lapses in the fifth inning.

Padres pitcher Tyson Ross got a single on a hit that dribbled down the third-base line and then advanced to second when catcher A.J. Pierzynski threw wildly to first. Then left fielder Kelly Johnson took a bad angle on Cory Spangenberg’s fly ball that dropped for a double that scored Ross.

Maybin saved a run by ending the inning with a tough catch. He tracked down Alonso’s deep drive near the wall, catching it with his back to the plate.

“I work my tail off at the plate but then I spend a lot of time taking pride in my defense,” Maybin said. “It was a big play. Those are the things you have to do. We are struggling as a team, trying to get things going as a team, you’ve got to make plays at both ends.”

Perez retired the Padres in order in the sixth and seventh innings and left with the 3-1 lead. Cunniff gave up a lead-off single to Spangenberg before striking out Upton and getting Alonso to ground into a double play. Jim Johnson retired the Padres in order in the ninth inning to earn the save.

The Padres apparently were unhappy with Braves shortstop Andrelton Simmons after he slid late and hard into catcher Derek Norris during Tuesday’s game. But their possible retaliation led to a run for the Braves in the second inning.

After Kelly Johnson’s one-out RBI single, Ross threw a pitch at Simmons’ legs that missed when Simmons shuffled out of the way. The wild pitch allowed Pierzynski to advance to second base and he scored when Simmons singled to right field.

When Perez hit Upton in the back with a pitch in the third inning, Upton slowly walked down the line as Pierzynski walked alongside him. There were no more flare-ups during the game.

The Braves added another run in the third inning for a 3-1 lead. Back-to-back singles by Perez and Jace Peterson and Maybin’s walk loaded the bases for Freddie Freeman, who grounded into a double play to score Perez.

Maybin’s one-out, bases loaded single in the seventh inning against Padres reliever Shawn Kelley gave the Braves more cushion.