ATLANTA -- Mike Foltynewicz out-pitched Jeff Samardzija and the last-place Atlanta Braves cooled off the San Francisco Giants on a sweltering Memorial Day.

Foltynewicz allowed just three hits and Mallex Smith smacked a bases-loaded triple off Samardzija in the second inning as the Braves beat the Giants 5-3 on a humid afternoon that saw the temperature hit 90 degrees.

Foltynewicz (2-2) gave up a home run to Brandon Belt in the second inning, but didn't allow another hit until the sixth. The right-hander was pulled after 89 pitches when Hunter Pence singled to open the seventh inning.

"He had good stuff. He pitched well," Giants manager Bruce Bochy said. "He pounded the strike zone with all his pitches. He throws hard and he had good command today. We just couldn't mount much [against him]."

It was just the third loss in 18 games for the Giants, who lead the National League West with a 32-21 record.

The Braves are just 5-21 at home and 14-36 overall -- the worst record in the majors.

Foltynewicz struck out four and walked two in his sixth start this season. His previous victory included eight scoreless innings at Kansas City, but he lasted just three innings in his next start at Pittsburgh.

"I took my time very well today," Foltynewicz said. "Hopefully, we can get these results more often instead of it being a roller coaster. ... I was just out there being comfortable and throwing strikes."

Samardzija, who was going for his fourth straight victory, allowed six hits and five runs (four earned) in five innings. The right-hander struck out four and walked two, one intentional, while falling to 7-3.

"I thought he had pretty good stuff," Bochy said. "He was just missing. ... Give the Braves credit."

The Giants made it interesting in the ninth inning against Braves closer Arodys Vizcaino against relievers Ian Krol and Hunter Cervenka.

Vizcaino gave up three straight hits in the ninth, including an RBI single by Brandon Crawford, and a second run scored on the Braves' second error of the inning before Kelby Tomlinson bounced into a game-ending force out.

Belt hit a 1-0 fastball from Foltynewicz over the right-field fence leading off the second for his fifth homer of the season, but the Giants' lead was short lived.

Smith, batting ninth, delivered a bases-loaded triple off Samardzija with two outs in the bottom of the inning and the Braves added two runs (one unearned) in the third inning.

"It's kind of puzzling right now," Samardzija said of his outing.

The triple to Smith came on a 1-0 cutter.

"It was over the plate and I was able to put a good swing on it," Smith said.

"It was a decent pitch, but with runners in scoring position and a one-run lead, you've got to try to get that out," Samardzija said.

Samardzija had given up just six runs in his previous five May starts, with no more than two runs in any of his outings.

Adonis Garcia singled and Nick Markakis, who had two hits, doubled in the second inning before an intentional walk to A.J. Pierzynski loaded the bases.

Gordon Beckham and Freddie Freeman opened the third inning with singles before Belt booted Markakis' grounder at first base for an error and Kelly Johnson followed with a sacrifice fly.

Belt and Pence each had two hits for San Francisco.

Giants third baseman Matt Duffy left the game after being hit on the left wrist by a Foltynewicz pitch in the sixth inning. X-rays were negative and Bochy said Duffy will likely be out no more than a day or two.

"We got good news on that," the manager said.

NOTES: The Giants arrived in Atlanta after 1 a.m. ET following a long flight from Denver, making for a quick turnaround for a 1:10 p.m. game to open the series against the Braves. ... Giants C Buster Posey was out of the lineup on a planned day off. He pinch hit in the ninth inning and reached on an error. ... RHP Jake Peavy (1-5, 7.26 ERA) will start for the Giants on his 35th birthday Tuesday against Braves RHP Matt Wisler (2-4, 3.08 ERA). ... With RHP Matt Cain (right hamstring strain) on the disabled list, the Giants plan to call RHP Albert Suarez out of the bullpen to start Wednesday's game. ... The Giants hope to activate RHP Sergio Romo (right flexor strain) Thursday after back-to-back minor league rehab outings Monday and Tuesday. The reliever has been on the DL since April 15. ... The Braves could activate RHP Jim Johnson (right groin strain) Friday after two more rehab games.