ATLANTA — Brandon Crawford felt confident that the San Francisco Giants were about to wrap up another victory and head to the hotel early.
Then everything fell apart.
"We probably should have put them away early," Crawford said. "Tough loss. We probably relaxed too much, and they jumped on us."
Crawford hit two home runs that helped the Giants to an early 6-0 lead, but starting pitcher Matt Cain and the San Francisco bullpen struggled in a 9-8 loss to the Atlanta Braves in 12 innings Monday night.
Adonis Garcia ended the game — and completed Atlanta's final comeback — with a two-run homer off Ryan Vogelsong in the bottom of 12th.
The Braves rallied with four runs in the sixth against Cain, then A.J. Pierzynski hit a two-run homer with two outs in the ninth off Santiago Casilla to tie it at 7.
Buster Posey, who had homered early, hit a go-ahead single in the top of the 12th for the Giants.
Jace Peterson led off the bottom of the 12th by reaching on a throwing error by Crawford from shortstop. Vogelsong (7-7), trying to earn the first save of his 11-season career, fell behind in the count and Garcia homered over the wall in center field.
"To get out to a big lead and let it go to waste and then to battle back in extras and still end up losing, it's definitely disappointing," Crawford said. "We just weren't putting together the same at-bats we were earlier in the game. Give credit to their bullpen, I guess."
Garcia made his major league debut this season and has three home runs in 11 games.
Both teams hit four homers.
Arodys Vizcaino (2-0) got two outs for the victory.
"Just to continue to battle and then go down again in the 12th — it's fun," said Pierzynski, who had four hits. "It's what this game is all about. Keep fighting. You never know what can happen."
The Giants have lost two straight for the first time since stopping a seven-game skid in early July.
Peterson and Chris Johnson homered for the Braves. Brandon Belt homered for the Giants.
Making his sixth start since returning from season-ending elbow surgery last year, Cain allowed 10 hits and four runs in five-plus innings.
"Kicking myself," Cain said. "We've got a six-run lead right there and that's the job of the starter, is to keep it and I didn't do a good job right there. With a lead like that, that can't happen."
Johnson, who replaced Freddie Freeman before the start of the fifth inning, homered off Hunter Strickland to make it 6-5 in the seventh. Freeman left with a strained right oblique, and the team listed him as day to day.
Nori Aoki's RBI single in the ninth off Andrew McKirahan gave San Francisco a 7-5 lead.
Braves starter Mike Foltynewicz allowed all four homers. Crawford has two multihomer games in his career, both against the Braves.
Giants: 2B Joe Panik will return to San Francisco on Tuesday for an MRI on his lower back. The team put him on the 15-day DL before the game. Panik has struggled for the last week with the injury. ... Manager Bruce Bochy changed the lineup an hour before the game, scratching CF Angel Pagan with right knee soreness. Gregor Blanco took his place. Pagan flied out as a pinch-hitter in the seventh.
Braves: SS Andrelton Simmons, sidelined for the second straight game by an injured right thumb, had an MRI on Monday, but manager Fredi Gonzalez said before the game that the results weren't immediately available. Daniel Castro replaced Simmons, a two-time Gold Glove winner, and went 1 for 5.
Giants: RHP Jake Peavy (2-4) is 3-4 with a 3.79 ERA in nine career starts against Atlanta. Since returning July 3 from back and hip pain, Peavy is 2-2 with a 3.12 ERA in five starts.
Braves: RHP Shelby Miller (5-8) seeks his first victory since May 17. He has lost six straight decisions and is 0-7 despite a 3.19 ERA in his last 13 starts.