The pitch was a few inches away from Braves starter Alex Wood wanted to throw it, and Paul Goldschmidt launched it a couple just to the right of where game-winners become harmless foul balls.

That’s how close Wood came to perhaps keeping the Braves’ winning streak alive. Instead, Goldschmidt’s two-run homer in the third inning lifted the Diamondbacks to a 3-1 victory on Sunday that ended the Braves’ majors-best winning streak at nine games.

With Braves hitters unable solve Arizona left-hander Wade Miley, Wood had a small margin for error. He made two costly mistakes in the third inning by walking Miley and offering a pitch that Goldschmidt drove out of the park.

“You go into the game telling yourself that there’s one guy you don’t want to let beat you, and then he ends up beating you,” Wood said. “Sometimes that’s how it goes.”

Goldschmidt stands out in a lineup that otherwise lacks much power. He entered the game tied for third in NL slugging percentage (.544) with 15 home runs, 32 doubles and 181 total bases.

After walking Miley to begin the third, Wood retired Ender Inciarte and Aaron Hill. He got Goldschmidt down 0-1 in the count before the slugger smashed a ball that hit the foul pole in left field.

“You make a mistake to Goldschmidt and a lot of times you are going to pay for it,” Braves left fielder Justin Upton said. “(Wood) did a great job. We can’t be mad at him. Nobody can be mad at anybody. Both pitchers threw well. We just came out on the short end of it.”

It was the end of the Braves’ longest winning streak since they won 14 games in a row spanning July and August of 2013. They swept the Phillies and Mets and won two out of three against the Diamondbacks, and now begin a seven-game road trip Monday at the Mets before the All-Star break.

The small-ball and strong pitching formula the Braves (49-39) used during the steak was still evident on Sunday even if didn’t mean a victory.

“We’ve been kind of a power-based team and we’ve won by just getting hits,” Braves first baseman Freddie Freeman said. “Today we had a few opportunities. We are not going to win the rest of the games; (the streak) was going to come to an end someday. But we did swing the bats really well again today and our pitching was obviously great. It just didn’t happen for us.”

After allowing the home run to Goldschmidt, Wood (6-7) allowed just two base runners over the next four innings. But Chris Johnson’s RBI single was one of just five hits allowed by Miley over 6 2/3 innings.

Miley (4-6) retired nine batters in a row from the last out of the fourth inning to the second out in the seventh.

“When he’s throwing his fastball on both sides of the plate and his slider is working, he’s pretty tough,” Upton said. “He did a good job against us today and we’ve got to tip our caps.”

Braves catcher Christian Bethancourt broke the streak with a two-out single in the seventh, and Diamondbacks manager Kirk Gibson brought in reliever Evan Marshall to face pinch hitter Dan Uggla. Uggla walked to bring up B.J. Upton but Marshall struck him out to end the threat.

In the eighth inning Braves shortstop Andrelton Simmons led off with a single and Justin Upton walked with one out against Arizona reliever Brad Ziegler. Jason Heyward grounded out and Chris Johnson struck out.

Early in the game it appeared the Braves might easily keep the line moving, as manager Fredi Gonzalez likes to call their small-ball approach.

In the first inning Braves shortstop Andrelton Simmons reached on a one-out bunt single and went to third on Freddie Freeman’s hit-and-run single. But Justin Upton struck out and Jason Heyward hit into a fielder’s choice to end the inning.

The Braves were back at it in the fourth when Justin Upton led off with a walk and scored on Chris Johnson’s bouncing single up the middle. But Miley got out of the inning with no more damage and shut the Braves down until the bullpen took over.

“It was just one of those days where we hit balls hard right at people and (Goldschmidt) was able to hit that pole,” Freeman said. “That’s all they needed. Wade pitched really well. It was a good streak.”