New York Mets rookie Pete Alonso watches his two-run single against the Atlanta Braves during the fifth inning of Thursday night's game in Atlanta.

ATLANTA — Pete Alonso and Amed Rosario helped the New York Mets pile up huge totals of hits and runs Thursday night.

Their team needed almost all of them to hold off the homer-happy host Atlanta Braves.

Alonso drove in six runs with five hits, including a three-run homer that helped lead to the shortest start of Julio Teheran's MLB career, and the Mets held on in the ninth inning to beat the Braves 10-8 and avoid a series sweep.

"It's incredible. It's hard to put in words, five knocks as a rookie," Mets starter Marcus Stroman said of Alonso. "It seems like he's on everything, barreling everything."

Alonso's first-inning homer carried 451 feet before making a splash landing in the pool behind the wall in center field at SunTrust Park.

Alonso's 39th homer tied Cody Bellinger for the National League rookie record. Bellinger hit 39 homers for the Los Angeles Dodgers in 2017, the same year the New York Yankees' Aaron Judge set the American League and MLB marks with 52.

"I don't stand alone," Alonso said. "I'm tied. Hopefully I keep on going and keep pushing forward. Hopefully I can stand alone in that category."

Alonso's hits and RBIs were his career bests in the majors.

The Mets had a season-high 23 hits. Rosario's MLB career-high five hits included two doubles, two singles and a triple. It was the first time in franchise history the Mets had more than one player with five hits.

"That's nuts. That's crazy," Alonso said when told about the duo setting history for the franchise, which started playing in 1962. "I think all of us kind of fed off Amed today."

Wilson Ramos added four hits.

New York won despite giving up six homers, including three in the ninth. Freddie Freeman and Josh Donaldson each hit his second homer of the game in the inning, and Ronald Acuña Jr. hit a two-run shot — all against Drew Gagnon.

Edwin Díaz walked Brian McCann before striking out Ender Inciarte for his 25th save of 2019.

Stroman (7-11) allowed three runs (two earned) on four hits in 5 1/3 innings. The right-hander earned his first win in three starts since being traded to New York by the Toronto Blue Jays on July 28.

Stroman gave up homers to Matt Joyce in the fourth and Donaldson, a former Blue Jay on a one-year deal with the Braves, in the sixth.

New York, trying to stay close in the NL wild-card race, snapped a three-game losing streak that included the first two games of the series.

Teheran (7-8) walked three straight batters to force in a run in the second. He left the game after giving up a run-scoring single to Ramos. Teheran recorded only four outs while giving up eight hits and six runs.

He fell to 1-2 in four starts against the Mets this season, including three straight in which he failed to last longer than four innings.

"My command wasn't there," Teheran said, adding he'll try to quickly move past the ugly outing. "I'm just going to put it in a bag and concentrate on the next one."

Todd Frazier's third-inning homer off Josh Tomlin increased New York's lead to 7-0.

Alonso drove in two runs with a fifth-inning single off Tomlin and added a run-scoring single off Anthony Swarzak in the seventh.

Acuña robbed J.D. Davis of a homer in the sixth by leaping and reaching above the yellow line atop the left-field wall for a catch. Acuña landed in a sitting position on the warning track before pausing and throwing the ball back to the infield as fans cheered.

"Kind of dramatic," Braves manager Brian Snitker said of the brief uncertainty about the catch. "Good for him. It's entertainment."

On the injury front, Braves shortstop Dansby Swanson (right foot contusion) hasn't been cleared to run but took fielding practice from his knees before the game. It's the same drill regularly used by third base coach Ron Washington with infielders. Swanson, who also played catch in the outfield, has been out since July 24.

Atlanta opens a three-game series against the West-leading Dodgers on Friday night, a rematch of a 2018 NL Division Series won by Los Angeles.

Atlanta right-hander Mike Soroka (10-2, 2.32) will make his first start against Los Angeles, which will counter with Kenta Maeda (8-8, 4.12).